docs
  1. Features
  2. Transactions & Orders
  3. Order Lifecycle & States

Order Lifecycle & States

Orders on SCAYLE follow a structured lifecycle, transitioning through multiple states based on business rules, customer actions, and fulfilment events. The table and flow chart below depicts them in detail.

Order States & Transitions

StateTriggerNext State
CREATEDCheckout initialized (When user navigates to Checkout page)PENDED
PENDEDCustomer submits order (“Confirm” clicked)CONFIRMED (after validation)
CONFIRMEDValidated with PSP + data integrity checksDELEGATED
DELEGATEDOrder items are sent to merchant to initiate shipments.SHIPPED, ABORTED
SHIPPED
  • All items were covered in shipment Message sent by merchant
  • When Order is force-closed
INVOICED, ABORTED
INVOICED
  • Invoice generation after full/partial shipment.
  • Final State for non cancelled orders.
NA
ABORTED
  • Delegation/shipment failure for all order items.
  • User cancellation
CANCELLED
CANCELLED
  • Final cancelled state after ABORTED processing.
  • Payment Cancellation request is made.
  • Final State for cancelled orders.
NA

Emails & Webhooks by State Transition

TransitionEmails SentWebhooks Triggered
PENDED → CONFIRMEDNoneorder-confirmed
CONFIRMED → DELEGATEDOrder confirmation mailorder-delegated, order-item-out-of-stock
DELEGATED → SHIPPEDShipment mail (per package)order-package-shipped, order-partially-invoiced, order-item-unshippable, order-corrective-invoiced
SHIPPED → INVOICEDInvoice emailorder-invoiced
Returns after INVOICEDReturn confirmation, Corrective invoiceorder-item-returned, order-corrective-invoiced
ABORTED → CANCELLEDCancellation mailorder-cancelled

Special & Edge Cases

  • Open State: An order may remain in state OPEN indefinitely (e.g., customer enters checkout and doesn't complete the payment)
  • Pended State: An order may remain in state PENDED indefinitely (e.g., customer exits session before completing confirmation or customer closes a payment window).
  • Force Closure: If no shipment is received from merchants within 14 days, the order is force-closed and marked SHIPPED.
  • Partial Delegation: Some items may be delegated; unfulfillable items are refunded and noted via separate webhooks.
  • Returns before INVOICED state: In case of multiple shipments, customer could return partial or all items of the first shipment before other packets are received.
  • Returns Consolidation: Returns within a 3-hour window are grouped to issue single corrective invoice. Only one email and refund is sent out for all the items returned within the 3 hour period.
  • Customer-Initiated Cancellation: Allowed up to the DELEGATED state. Some merchants may deny cancellation post-delegation.
  • Corrective Invoices: Triggered for post-shipment stock issues or unshippable returns.

This flowchart illustrates the complete order lifecycle process, from order creation and validation to delegation, shipping, invoicing, cancellations, and returns management.

Order Lifecycle