CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/Retail & E-commerce

πŸ›’ Retail & E-commerce Β· Sequence

Checkout and Payment Sequence

What happens when a shopper clicks Pay: stock is reserved, the payment is authorised, the order is created and stock is released again if payment fails.

More Retail & E-commerce templates

Drawing diagram…

What this diagram shows

  • Stock is reserved before payment so items don't oversell
  • Failed payments release the reserved stock
  • Confirmation email is sent only after the order is saved

Prompt used

Checkout sequence: the shopper clicks Pay, the order service asks the inventory service to reserve stock, then calls the payment service which charges the payment gateway. On success the order is saved as confirmed and a confirmation email is sent. On failure the reserved stock is released and the shopper sees a retry option.

Mermaid code
sequenceDiagram
  actor S as Shopper
  participant W as Web Store
  participant O as Order Service
  participant I as Inventory Service
  participant P as Payment Service
  participant G as Payment Gateway
  S->>W: Click Pay
  W->>O: Place order
  O->>I: Reserve stock
  I-->>O: Reserved
  O->>P: Charge Rs 2,499
  P->>G: Authorise
  alt Payment succeeds
    G-->>P: Success
    P-->>O: Paid
    O->>O: Save order as confirmed
    O-->>W: Order confirmed
    O-)S: Confirmation email
  else Payment fails
    G-->>P: Declined
    P-->>O: Failed
    O->>I: Release stock
    O-->>W: Show retry option
  end

Related templates

C4 ArchitectureProRetail & E-commerce

E-commerce Microservices Architecture

An online store split into microservices: catalog, cart, orders, payments and search, with Kafka events connecting them to shipping and notifications.

State MachineRetail & E-commerce

Order Lifecycle State Machine

Every status an online order moves through, from placed to delivered, including cancellations, returns and refunds.

Database ERDRetail & E-commerce

Product Catalog Database Schema

A flexible product catalog: categories, products with variants (size, colour), prices, stock per warehouse and images.

Data FlowRetail & E-commerce

Omnichannel Inventory Sync

How stock stays in sync across stores, warehouses and marketplaces so the same item isn't sold twice.

FlowchartRetail & E-commerce

Returns and Refunds Workflow

How an online store handles a return: eligibility, pickup, quality check at the warehouse and the refund or replacement.

Data FlowRetail & E-commerce

Product Recommendation Engine

How an online store builds 'recommended for you' and 'frequently bought together': click and order data, model training and a fast serving layer.