Flows

Checkout saga

The orchestration pattern used by checkout to coordinate inventory reservation, payment authorization and order creation.

Flow

Checkout SagaCheckout SagaFlowv1.0.0How the Checkout Orchestrator turns a checked-out cart into an order — reserving inventory, authorizing payment and crea...Ownerordering-platformView flowView docs is the detailed orchestration inside Checkout SystemCheckout SystemSystemv1.0.0Internal system that orchestrates checkout. When a cart is checked out it reserves inventory, authorizes payment, and as...Ownerordering-platformMapView docs. It exists because checkout cannot be a single local transaction: inventory, payment and order state are owned by different systems.

Flow map

Saga steps

StepContractOwner
Reserve inventoryReserve InventoryReserve InventoryCommandv1.0.0Command to reserve stock for the items in a checked-out cart. Ownerordering-platformSchemaMapView docsInventory SystemInventory SystemSystemv1.0.0Internal system that tracks stock and reserves it for orders. It is the source of truth for available inventory and conf...Ownerfulfilment-platformMapView docs
Authorize paymentAuthorize PaymentAuthorize PaymentCommandv1.0.0Command to authorize payment for the total of a checked-out cart. Ownerordering-platformSchemaMapView docsPayment Processing SystemPayment Processing SystemSystemv1.0.0Internal system that orchestrates payment for orders. It authorizes payments, requests charges from the external payment...Ownerpayments-platformMapView docs
Create orderCreate OrderCreate OrderCommandv1.0.0Command to create a new order from a checked-out cart. Ownerordering-platformSchemaMapView docsOrder Management SystemOrder Management SystemSystemv1.0.0Internal system that is the source of truth for orders. It creates orders, tracks their lifecycle, and publishes events ...Ownerordering-platformMapView docs

Success condition

Checkout succeeds only when inventory is reserved, payment is authorized and an order is created. The durable outcome is an order in Order DatabaseOrder DatabaseContainerv1.0.0PostgreSQL database that is the system of record for orders and their items.Ownerordering-platformMapView docs and subsequent Order CreatedOrder CreatedEventv1.0.0Published when a new order has been created. Ownerordering-platformSchemaMapView docs publication.

Compensation

If inventory is unavailable or payment is declined, checkout should not create an order. The orchestrator should release any previous reservation or void any authorization as needed.

Change guidance

Adding a checkout step means updating:

  • the flow definition,
  • the orchestrator implementation,
  • the command/event contracts,
  • failure and compensation behavior,
  • customer-facing status semantics.
Review saga compensation
Open in Cursor