Software Design

E-Commerce Order State Machine

State Diagrams · made in Skemio

State diagram showing order lifecycle: Initial to Pending Payment, moving to Processing on payment, Shipped on dispatch, Delivered, or Cancelled.
State diagram showing order lifecycle: Initial to Pending Payment, moving to Processing on payment, Shipped on dispatch, Delivered, or Cancelled.

What it shows

  • Explicit state transitions block illegal jumps like shipping unpaid items.
  • Cancellation rules differ by state: instant early on, complex once packed.
  • Terminal states like Delivered and Cancelled lock database records.

The takeaway

Model checkout and fulfillment as a finite state machine to prevent race conditions and ghost shipments.

More state diagrams