Order status lifecycle and order handling in Business Manager
Key Takeaway
An order starts as CREATED and then is either placed (NEW) or FAILED. Cancelling works only on OPEN, NEW or COMPLETED orders. Undoing a failed order returns it to CREATED, not NEW.
Every B2C Commerce order has an order status that moves through a fixed lifecycle. An order is CREATED from a basket and is then placed (NEW or OPEN) or FAILED. A placed order can later be CANCELLED. Developers drive these moves with OrderMgr methods. Merchants use Business Manager and the site's Order preferences to cancel, export, delete and automatically clean up orders.
The statuses an order tracks
An order tracks several separate statuses. Each status has its own constants on dw.order.Order:
- Order status (
status) - Export status (
exportStatus) - Payment status (
paymentStatus) - Shipping status (
shippingStatus) - Confirmation status (
confirmationStatus)
The order status is the one that moves through the lifecycle. Its constants are:
| Constant | Value | Meaning |
|---|---|---|
ORDER_STATUS_CREATED | 0 | Created from a basket and not yet placed |
ORDER_STATUS_NEW | 3 | Placed |
ORDER_STATUS_OPEN | 4 | Same meaning as NEW |
ORDER_STATUS_COMPLETED | 5 | No meaning by default, but custom implementations can use it. A synonym for NEW and OPEN. |
ORDER_STATUS_CANCELLED | 6 | Cancelled after being placed |
ORDER_STATUS_REPLACED | 7 | Related to BasketMgr.createBasketFromOrder(), which supports editing an order and replacing it |
ORDER_STATUS_FAILED | 8 | Not placed because the order was not valid |
In a replacement chain where Order1 is replaced by Order2, Order1 is the original order and Order2 is the current order.
Every status change is recorded in the anonymous Order Journal. The Order Journal is the base for GMV calculations.