Skip to content

Order Lifecycle

Models the full lifecycle of a retail Order from initial creation through fulfilment, completion, and post-sale outcomes (return, exchange). Applies across all channels: eCommerce, POS, clienteling, and assisted selling.

Object: order · States: 7 · Transitions: 10


State Diagram

flowchart LR

    %% ── classDef palette ─────────────────────────────────────
    classDef stInit  fill:#0d9488,stroke:#0f766e,color:#fff,font-weight:bold
    classDef stNorm  fill:#3b82f6,stroke:#2563eb,color:#fff
    classDef stOk    fill:#16a34a,stroke:#15803d,color:#fff,font-weight:bold
    classDef stFail  fill:#dc2626,stroke:#b91c1c,color:#fff,font-weight:bold
    classDef stHold  fill:#d97706,stroke:#b45309,color:#fff

    %% ── nodes ───────────────────────────────────────────────
    draft(["Draft"])
    confirmed["Confirmed"]
    in_fulfilment["In Fulfilment"]
    partially_fulfilled["Partially Fulfilled"]
    completed[["Completed"]]
    return_in_progress["Return In Progress"]
    cancelled[["Cancelled"]]

    %% ── transitions ─────────────────────────────────
    draft -->|"order-confirmed"| confirmed
    draft -->|"order-cancelled"| cancelled
    confirmed -->|"order-routed"| in_fulfilment
    confirmed -->|"order-cancelled"| cancelled
    in_fulfilment -->|"order-modified"| partially_fulfilled
    in_fulfilment -->|"order-closed"| completed
    partially_fulfilled -->|"order-closed"| completed
    in_fulfilment -->|"order-cancelled"| cancelled
    completed -->|"order-modified"| return_in_progress
    return_in_progress -->|"order-closed"| completed

    %% ── class assignments ───────────────────────────
    class draft stInit
    class confirmed,in_fulfilment,partially_fulfilled,return_in_progress stNorm
    class completed stOk
    class cancelled stFail

States

State Label Description Initial Terminal
draft Draft Order created but not yet commercially confirmed. Payment not yet captured.
confirmed Confirmed Commercial commitment accepted. Payment authorized. Fulfilment may begin.
in-fulfilment In Fulfilment At least one Fulfilment Order has been created and is being processed.
partially-fulfilled Partially Fulfilled Some order lines have been dispatched; others are still in fulfilment.
completed Completed All lines delivered. Payment fully captured. Order is closed.
return-in-progress Return In Progress Post-completion state when one or more returns are active against this order.
cancelled Cancelled Order voided before or during fulfilment. Payment authorization released.

Transitions

From To Trigger Guards
draft confirmed order-confirmed Payment authorization obtained; All order lines pass catalogue validation; Customer identity resolved
draft cancelled order-cancelled No payment capture has occurred
confirmed in-fulfilment order-routed At least one Fulfilment Order created
confirmed cancelled order-cancelled No Fulfilment Order has started picking; Payment capture reversed or not yet captured
in-fulfilment partially-fulfilled order-modified At least one line dispatched; At least one line still in fulfilment
in-fulfilment completed order-closed All lines delivered; Payment fully captured
partially-fulfilled completed order-closed All remaining lines delivered or cancelled; Payment reconciled
in-fulfilment cancelled order-cancelled All active Fulfilment Orders are cancelled; Payment capture reversed where applicable
completed return-in-progress order-modified Return window is open; At least one eligible return line exists
return-in-progress completed order-closed All active returns resolved (refunded or rejected)