Order Status
A typical order lifecycle begins with a customer finalizing the checkout process and ends with delivering the products. Between those two points, the order can go through several states. This article describes the possible states of an order and the transitions between them.
Settings​
Several settings can affect the behavior of the order. You can find them in the channel.orderSettings object.
Order status​
Below is a diagram that shows the possible states of an order and the transitions between them. Names of the states are drawn from the OrderStatus enum. Each state is described in detail in the following sections.
The order is initiated either by creating a draft version or completing a checkout.
flowchart TD
CreatedDraft[Draft order created] --> DRAFT(DRAFT)
CheckoutCompleted[Checkout Completed]
DRAFT -->| Draft order complete | isAutomated{Is automated<br> order confirmation turned on?}
CheckoutCompleted --> isAutomated
isAutomated -->|Yes| UNFULFILLED
isAutomated -->|No| UNCONFIRMED(UNCONFIRMED)
UNCONFIRMED -->|Expire time overdue| EXPIRED(EXPIRED)
UNCONFIRMED -->|Confirm order| UNFULFILLED
UNFULFILLED -->|Create fulfillment| isNotFulfilled{Are there unfulfilled<br> order lines?}
isNotFulfilled -->|Yes| PARTIALLY_FULFILLED(PARTIALLY_FULFILLED)
isNotFulfilled -->|No| FULFILLED(FULFILLED)
UNFULFILLED -->|Cancel order| CANCELLED(CANCELLED)
FULFILLED -->|Return products| isNotReturned
FULFILLED -->|Cancel fulfillment| isAllCancelled
PARTIALLY_FULFILLED -->|Create fulfillment| isNotFulfilled
PARTIALLY_FULFILLED --->|Return products| isNotReturned{Are there unreturned<br> order lines?}
PARTIALLY_FULFILLED --->|Cancel fulfillment| isAllCancelled{Are all fulfillments<br> cancelled?}
isAllCancelled ~~~ isNotFulfilled
isAllCancelled -->|No| PARTIALLY_FULFILLED
isAllCancelled -->|Yes| UNFULFILLED
isNotReturned -->|Yes| PARTIALLY_RETURNED(PARTIALLY_RETURNED)
isNotReturned -->|No| RETURNED(RETURNED)
PARTIALLY_RETURNED -->|Return products| isNotReturned
DRAFT​
stateDiagram-v2
direction LR
[*] --> DRAFT: Draft order created in the Dashboard or the API
DRAFT --> UNFULFILLED: Order confirmed
DRAFT --> [*]: Draft order removed
- Result of
draftOrderCreatemutation. - Item stocks are not allocated.
Available transitions​
- Remove: removed
DRAFTorders are not visible in the dashboard. - Finalize: the status will change to
UNFULFILLED.
UNCONFIRMED​
stateDiagram-v2
direction LR
[*] --> UNCONFIRMED
UNCONFIRMED --> UNFULFILLED: Order confirmed
UNCONFIRMED --> EXPIRED: Expire time has passed
UNCONFIRMED --> CANCELED: Order canceled
- Item stocks are allocated for ProductVariants with
ProductVariant.trackInventoryturned on. - this state is the result of
checkoutCompletemutation, ifchannel.orderSettings.automaticallyConfirmAllNewOrdersis set toFalse.
Available transitions​
- Confirm: the status will change to
UNFULFILLED. - Expire: the status will automatically change to
EXPIREDif the order is older thanchannel.orderSettings.expireOrdersAfterminutes. This will happen automatically only if no transaction attempts were made. - Cancel: the status will change to
CANCELEDand order will be visible in the dashboard.
UNFULFILLED​
stateDiagram-v2
state if_state_fulfillments <<choice>>
state if_state_returns <<choice>>
direction LR
[*] --> UNFULFILLED
UNFULFILLED --> if_state_fulfillments: Fulfillment created
if_state_fulfillments --> FULFILLED: All products fulfilled
if_state_fulfillments --> PARTIALLY_FULFILLED: Products waiting for fulfillment
UNFULFILLED --> CANCELED: Order canceled
UNFULFILLED --> if_state_returns: Return items
if_state_returns --> RETURNED: All products returned
if_state_returns --> PARTIALLY_RETURNED: Not all products returned
- Item stocks are allocated for ProductVariants with
ProductVariant.trackInventoryturned on. - Result of
orderConfirmmutation or finishing a checkout in a channel with automatic confirmation.
Available transitions​
- Fulfill: creating fulfillments will result in transition to
PARTIALLY_FULFILLEDorFULFILLEDstate, depending on whether there are any unfulfilled items left. For items with inventory tracking enabled, this will also deduct stock quantity from warehouses and release allocations. - Return: creating returns will result in transition to
PARTIALLY_RETURNEDorRETURNEDstate. Returning items will not modify stock. - Cancel: the status will change to
CANCELEDand order will be visible in the dashboard.
PARTIALLY_FULFILLED​
stateDiagram-v2
direction LR
[*] --> PARTIALLY_FULFILLED
state if_state_fulfillments <<choice>>
state if_state_returns <<choice>>
state if_state_cancel_fulfillments <<choice>>
PARTIALLY_FULFILLED --> if_state_fulfillments: Fulfillment created
if_state_fulfillments --> PARTIALLY_FULFILLED: Products waiting for fulfillment
if_state_fulfillments --> FULFILLED: All products fulfilled
PARTIALLY_FULFILLED --> if_state_cancel_fulfillments: Fulfillment canceled
if_state_cancel_fulfillments --> PARTIALLY_FULFILLED: Not all fulfillments canceled
if_state_cancel_fulfillments --> UNFULFILLED: All fulfillments canceled
PARTIALLY_FULFILLED --> if_state_returns: Return items
if_state_returns --> PARTIALLY_RETURNED: Not all products returned
if_state_returns --> RETURNED: All products returned
- Stocks of unfulfilled items are allocated, and fulfilled items are deducted from the stock quantity.
- Result of
orderFulfillmutation.
Available actions​
- Fulfill: creating fulfillments will result in transition to
PARTIALLY_FULFILLEDorFULFILLEDstate, depending on whether there are any unfulfilled items left. For items with inventory tracking enabled, this will also deduct stock quantity from warehouses and release allocations. - Cancel fulfillment: cancelling all fulfillments will result in transition to
UNFULFILLEDstate. Items with inventory tracking enabled will be restocked in the warehouse specified in the input oforderFulfillmentCancelmutation. - Return: creating returns will result in transition to
PARTIALLY_RETURNEDorRETURNEDstate. Returning items will not modify stock.
FULFILLED​
stateDiagram-v2
direction LR
[*] --> FULFILLED
state if_state_returns <<choice>>
state if_state_cancel_fulfillments <<choice>>
FULFILLED --> if_state_returns: Return items
if_state_returns --> PARTIALLY_RETURNED: Not all products returned
if_state_returns --> RETURNED: All products returned
FULFILLED --> if_state_cancel_fulfillments: Cancel fulfillment
if_state_cancel_fulfillments --> PARTIALLY_FULFILLED: Not all fulfillments canceled
if_state_cancel_fulfillments --> UNFULFILLED: All fulfillments canceled
- No allocations, stocks already deducted from warehouses.
- Result of
orderFulfillmutation. - Purpose: order is fulfilled, waiting for optional operations: return, refund.
PARTIALLY_RETURNED​
stateDiagram-v2
direction LR
[*] --> PARTIALLY_RETURNED
state if_state_returns <<choice>>
PARTIALLY_RETURNED --> if_state_returns: Return items
if_state_returns --> PARTIALLY_RETURNED: Not all products returned
if_state_returns --> RETURNED: All products returned
- Some of the items were marked as returned.
- Return procedure does not modify stocks automatically.
RETURNED​
- All of the items were marked as returned.
EXPIRED​
- Stock allocations are released.
- It will happen automatically based on channel settings.
Available actions​
This state cannot be changed.
CANCELED​
- Stock allocations are released.
- Result of
orderCancel. - Possible previous states: UNCONFIRMED, UNFULFILLED.
Available actions​
This state cannot be changed.