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
State | Trigger | Next State |
---|---|---|
CREATED | Checkout initialized (When user navigates to Checkout page) | PENDED |
PENDED | Customer submits order (“Confirm” clicked) | CONFIRMED (after validation) |
CONFIRMED | Validated with PSP + data integrity checks | DELEGATED |
DELEGATED | Order items are sent to merchant to initiate shipments. | SHIPPED , ABORTED |
SHIPPED |
| INVOICED , ABORTED |
INVOICED |
| NA |
ABORTED |
| CANCELLED |
CANCELLED |
| NA |
Emails & Webhooks by State Transition
Transition | Emails Sent | Webhooks Triggered |
---|---|---|
PENDED → CONFIRMED | None | order-confirmed |
CONFIRMED → DELEGATED | Order confirmation mail | order-delegated , order-item-out-of-stock |
DELEGATED → SHIPPED | Shipment mail (per package) | order-package-shipped , order-partially-invoiced , order-item-unshippable, order-corrective-invoiced |
SHIPPED → INVOICED | Invoice email | order-invoiced |
Returns after INVOICED | Return confirmation, Corrective invoice | order-item-returned , order-corrective-invoiced |
ABORTED → CANCELLED | Cancellation mail | order-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