StateState machineMedium

E-commerce order lifecycle

State transitions of an order from creation through fulfillment, cancellation, or refund.

E-commerce order lifecycle preview

What this diagram shows

Step 01
Creation

Orders start in Created and move to Paid once payment is captured.

Step 02
Fulfilment branches

Paid orders either ship and complete, or roll back via refund.

Step 03
Terminal states

Cancelled, Completed, and Refunded all close the lifecycle.

About state diagrams

State diagrams describe the states an entity can be in and the transitions between them. Use them for order lifecycles, subscription statuses, approval flows, or any object with meaningful modes.

This template is written in Mermaid — plain text you can edit, version in git, and regenerate the image from any time.

View Mermaid sourcePlain-text diagram syntax — copy or edit directly.
diagram.mmd
1stateDiagram-v2
2 [*] --> Created
3 Created --> Paid: payment captured
4 Created --> Cancelled: user cancels
5 Paid --> Fulfilled: shipped
6 Paid --> Refunded: refund requested
7 Fulfilled --> Completed: delivered
8 Fulfilled --> Refunded: return approved
9 Cancelled --> [*]
10 Completed --> [*]
11 Refunded --> [*]