docs
  1. SCAYLE Resource Center
  2. Developer Guides
  3. Transactions & Orders
  4. General

General

SCAYLE allows you to retrieve order data with all related information such as address, customer, items and etc. You can also update the order reference key.

Orders have different statuses that depend on the shipping, billing, and item statuses. These statuses help you to track the order progress, inform customers, and troubleshoot.

Depending on the state in the order flow, the Admin API returns status information consisting of the following:

  • detailedStatus.order (e.g, order_created, order_pended, order_confirmed)
  • detailedStatus.billing (e.g., shipping_open, shipping_ordered)
  • detailedStatus.shipping (e.g., billing_open, billing_completed)
  • items.status for each item in the order (e.g., available, returned)

The shipping, billing, and item statuses determine the overall status.

Order Status

Overall Order Status

The following order statuses can be triggered during the checkout process. Each order status corresponds to a status in the SCAYLE Panel.

StatusDescriptionSCAYLE Panel Label
order_created, order_openAs soon as the customer enters the checkout (i.e., when an order is created). Or when an order is reverted back from order_pended.Open
order_pendedAs soon as the customer places an order by clicking on the “Confirmed” button. This triggers the validation process with the chosen Payment Service Provider (PSP). It is possible that the order never leaves the state order_pended (e.g., customer logs out before completing the process).Payment Pending
order_confirmedAs soon as the Payment Service Provider validation is successful the state changes to order_confirmed.Payment Reserved
order_delegatedThe status transitions to order_delegated when the order is delegated to the merchants associated with the order items.Payment Reserved
order_shippedThe status transitions to order_shipped when the shipping process started and the merchants send a shipping notification.Shipped
order_invoicedAs soon as the Invoice.pdf is created. This triggers the sending of the order confirmation email. This is an optional step if the invoicing is done by SCAYLE. If invoicing is done in an ERP the order state does not change.Completed
order_abortedWhen an order cancellation is sent a record to cancel the order is created. While the record has status pending, the cancellation is pending.Payment Cancelled
order_cancelledThe order is fully cancelled.Payment Cancelled
order_importedThe order is imported. This status generally applies to orders migrated from previous systems.-
order_invoice_errorThere was an error generating the invoice.-

Shipping Status

StatusDescriptionSCAYLE Panel Label
shipping_openWhen a customer enters checkout, through payment reservation, until delegation.New
shipping_orderedWhen the order is delegated to the merchants associated with the items of the order.Ordered
shipping_deliveredWhen the shipping process starts and the merchants send a shipping notification.Shipped
shipping_cancelledThe order is fully cancelled.Cancelled
shipping_undeliverableInformation from the merchant indicates the items are not deliverable.Not deliverable
shipping_partially_deliveredFor orders with multiple items, information from the merchant indicates at least one item is not deliverable.Partially undelivered

Billing Status

StatusDescriptionSCAYLE Panel Label
billing_openAs soon as the customer enters the checkout (i.e., when an order is created). Or when an order is reverted back from payment_pending.Open
billing_pendingAs soon as the customer places an order by clicking on the “Confirmed” button.Open
billing_payment_pendingWhen the customer confirms they want to order and they are redirected to the payment provider.Payment Pending
billing_completedAs soon as the Invoice.pdf is created. This triggers the sending of the order confirmation email.Completed
billing_payment_abortedCustomer aborts the payment process between billing_open and billing_payment_pending.-
billing_payment_cancelledThe order is cancelled due to no deliverable items or customer explicitly cancels the order.Payment Cancelled
billing_refundedThe order is refunded.Refunded
billing_denied--

Item Status

The following statuses are possible at the item-level. To understand how status changes at the item level affect the shipping and billing status, see the Order Flow table below.

StatusDescriptionCorresponding Order State
availableItem is available.Shipping
unavailableItem is not available.Shipping
deliverableInformation from the merchant indicates item is deliverable.Delegated
undeliverableInformation from the merchant indicates item is not deliverable.Delegated
cancelledItem cancelled.Shipping
returnedItem cancelled.Invoiced

Dependencies

The following table outlines which statuses can occur together.

Order StatusShipping StatusBilling StatusSCAYLE Panel Shipping StatusSCAYLE Panel Billing Status
order_createdshipping_openOpenNewOpen
order_pendedshipping_openbilling_pendingNewPayment Pending
order_confirmedshipping_openbilling_pending, billing_payment_pending, external_payment_pending or billing_completedNewPayment Pending
order_delegatedshipping_orderedbilling_pending, billing_payment_pending, external_payment_pending or billing_completedNewPayment Pending
order_shippedshipping_deliveredbilling_pending, billing_payment_pending, external_payment_pending or billing_completedShippedPayment Pending
order_invoicedshipping_deliveredbilling_payment_pending , external_payment_pending or billing_completedShippedPayment Pending, Completed
order_aborted---Payment Cancelled
order_cancelledshipping_cancelled, shipping_undeliverable or shipping_not_deliverablebilling_payment_aborted, billing_payment_cancelled, billing_refunded or billing_deniedCancelled, Not DeliverablePayment Cancelled, Refunded
order_invoicedshipping_partially_deliveredbilling_payment_pending, external_payment_pending or billing_completed Partially UndeliveredPayment Pending, Completed

Order flow

For each step in the order flow, an order has both a Shipping Status and a Billing Status as indicated in the diagram below. The table below describes each step, including how item-level changes affect the statuses.

Billing and Shipment statuses

StepSummaryDescription
1Customer enters checkoutAs soon as the customer enters the checkout (i.e., Basket transferred from the Shop to the Checkout system), an order will be created (regardless of whether the customer is logged in or not). If the customer is logged in, the connection between the order and customer is already made.
2Customer aborts checkoutIf the customer interrupts the checkout process without finishing it (e.g., the customer closes the browser), the order and statuses will remain in the system. If the customer logs into their profile again, this order will not be displayed. Third-party systems will not know about these orders, because no notification/webhook will be sent.
3Items not available (edge case)In some cases, items get reserved during the process and are not available for the current basket (run out of a virtual stock). Since it is not possible to purchase them, the order will be empty and keep the statuses (similar to step 2).
4Order confirmationThe customer confirms they want to order the items. They will be redirected to the payment provider (e.g. PayPal). Billing status changes to PAYMENT PENDING. Checkout waits for the response of the PSP to confirm payment coverage. If the payment is not covered/successful, the billing status switches back to NEW.
5Customer aborts paymentIf the customer aborts the payment process, the order will still be kept in the system (similar to step 2). In this case, the billing status is PAYMENT PENDING.
6Payment is coveredThe payment is covered. Depending on the PSP used, the responses may look different. For example, PayPal delivers all required data with the response and adds them to the return URL.

Other services (e.g., Adyen) do not deliver the payment information right away and the status is updated to PAYMENT RESERVED after a webhook indicating the transaction was successful. Generally, the process is very fast, so the customer will not notice this response period.
7Order delegationAfter successful payment reservation, Checkout delegates the order to SCAYLE. Virtual stocks for items are verified. An artificial delay of one minute is added as a safety measure. The order confirmation webhook is triggered. After the delegation, a confirmation mail is sent to the customer. If SCAYLE has any problems processing the delegation, it will retry every minute for two days. If not successful after two days, the order is CANCELLED. If at least one item is valid, the shipping status is ORDERED. Billing status remains unchanged.
8Items not availableIf there is not at least one item of the order in stock/deliverable, the whole order gets CANCELLED. There is no further processing of the order. A mail will be sent informing the customer of cancellation.
9Items availableIf at least one item of the successful order is available, the shipment phase begins. If an item is deliverable, it will get the status SHIPPED and a shipment notification is sent. If it is not deliverable, the item gets cancelled. In this case, a notification is also sent.
10Shipping cancelledIf all items of the order get the shipment status CANCELLED, the order gets is status too. A notification mail is sent.
11ShippedAfter the status of the order is switched to SHIPPED, the invoicing phase of the process starts including: generation of invoice number, sending invoice notification email, and contacting payment provider.
12Forced closure (edge case, optional)If the warehouse does not send a shipment notification, after 14 days with no update, Checkout assumes that the item was shipped (status ASSUMED SHIPPED). Also after max. 14 days, the billing status PAYMENT RESERVED switches to COMPLETED. In rare cases, it may occur that this forced closure leads to an invoice for an item that was not shipped. In this case, customer service agents can trigger a manual refund via the SCAYLE Panel. Forced closure is an optional process that can be activated on request.
13ReturnedAfter Checkout receives a returned item, the shipment status changes to RETURNED. The system then waits 4 hours if additional items get returned (the time frame resets every time a new item gets returned). For each returned set of items, a mail notification is sent. If at least one item is returned (but not all items), the status switches to PARTIALLY RETURNED and PARTIALLY REFUNDED

Get order data

SCAYLE allows you to retrieve an order by its reference key or ID.

This method can be used to get an existing order.

This method allows including nested resources using the with parameter.

let response = await adminApi.apis.Orders.getOrder({shopKey: shopKey, countryCode: countryCode, orderIdentifier: orderIdentifier});
let order = response.body;

Options

param nametyperequiredDetails
withstringfalse

Allows to load the following nested resources within this request:

  • legacyCustomData
  • items.legacyCustomData
  • customer.legacyCustomData

Parameters

param nametyperequireddescription
idintegertrueThe ID of the order created. Read-only
addressOrderAddressBilling and Shipping address of the customer
basketKeystringtrueA key that uniquely identifies the customer's cart
confirmedAtstringTimestamp when the order was confirmed
contactsOrderContactCollection of contacts
costOrderCosttrueTotal cost of the order that includes tax, VAT, etc
currencyCodestringtrueISO 4217 currency code
customerCustomerDetails about the customer account
shopCountryShopCountryCountry of the shop as ISO 3166 alpha 2 country code
invoicedAtstringTimestamp when the invoice is sent
createdAtstringTimestamp when the order is created
updatedAtstringTimestamp when the order is updated
itemsOrderItemCollection of items ordered
legacyCustomDataarrayCustom data added to the order (legacy feature)
membershipDiscountOrderMembershipDiscountMembership discount information
packages OrderPackageDetails for the package(s) part of the order
paymentOrderPaymentPayment details
publicKeystringPublic reference set by the client to display to customers in account areas and transactional emails
referenceKeystringtrueExternal order reference set by the client to integrate a third-party system
shipping OrderShippingShipping details
statusstringtrueStatus of the order, e.g., invoice_completed
detailedStatusOrderDetailedStatustrueDetailed status of the order
vouchers OrderVoucherApplicable voucher and its details
loyaltyCardOrderLoyaltyCardLoyalty card information

Get by Reference Key

This endpoint is not shop country scoped, but the shop country, identified by shopKey and countryCode, is still needed.

Get an order by reference key:

let response = await adminApi.apis.Orders.getOrder({shopKey: 'ms', countryCode: 'DE', orderIdentifier: "key=my-key"});
let order = response.body;

console.log(order.id);

Get with Legacy Custom Data

Get an order with legacy custom data:

let response = await adminApi.apis.Orders.getOrder({
    shopKey: 'ms',
    countryCode: 'DE',
    orderIdentifier: "key=my-key",
    with: 'legacyCustomData'
});

let order = response.body;

console.log(order.legacyCustomData);