The order lifecycle

Learn about the order lifecycle

An order has a defined lifecycle. Each stage of that lifecycle is represented by state. When an order's state changes, an event is created that represents that change. For example, when an order's state transitions from accepted to fulfilled an order.fulfilled event is created.

Order states and events

The following lists an order's enumerated state values and the events associated with each state change. These state transitions are listed in the approximate sequence they might occur in an order's lifecycle:

(1) When the order...(2) state transitions to...(3) and an ... event is emitted.

charge isn't yet capturable and could still be pending fraud review

charge is capturable, but the order requires further fraud review, and, as a result, is still not ready to fulfill

charge is capturable, has passed fraud review or the Denied Parties List (DPL), and is ready to fulfill

fails because it is blocked by fraud review or the customer is determined to be on the DPL

blocked

is fully cancelled

is completely fulfilled or partially fulfilled and the remaining items[] are cancelled

is fulfilled and the charge is fully captured or partially fulfilled with a partially captured charge and the remaining items[] are cancelled or

the order charge is complete

complete

is fully returned or partially returned and its remaining items[] are cancelled or partially/fully refunded

returned

order.refunded

charges are disputed

dispute

The state values for a successful order (i.e. the happy path) are pending_payment > in_review > accepted > fulfilled > complete . As the order moves from one state to another, that event is recorded with a timestamp in stateTransitions.

Fraud review

An order must also pass through fraud review. When exactly this review occurs in an order's lifecycle depends on the payment method used by the customer. The different stages of the review are represented by fraudState, whose enumerated values are review_opened, blocked, and passed. When fraudState changes, an event is created.

Last updated