Skip to content
arch-lab

Checkout — Place Order

One order placed: card charged, order stored, receipt sent.

alt[card accepted][card declined]par[receipt][audit]opt[first purchase]CustomerStorefront[Next.js]Order API[Go]Hide the 2 services only Order API usesPayments[Stripe]Orders DB[PostgreSQL]Price and stock re-checked server-sideOrder flow complete1. Clicks Place order2. Place the order [HTTPS]3. Validates the cart4. Create charge [REST]5. charge.succeeded6. INSERT order [SQL]7. Emails the receipt8. Writes audit row9. 201 Created10. 402 Payment Required11. Shows onboarding tips
  1. Customer to Storefront (sync): Clicks Place order
  2. Storefront to Order API (sync): Place the order [HTTPS]
  3. Order API to Order API (sync, self-message): Validates the cart
  4. Order API to Payments (sync): Create charge [REST]
  5. Payments to Order API (reply): charge.succeeded
  6. Order API to Orders DB (sync): INSERT order [SQL]
  7. Order API to Customer (async): Emails the receipt
  8. Order API to Orders DB (async): Writes audit row
  9. Order API to Storefront (reply): 201 Created
  10. Order API to Storefront (reply): 402 Payment Required
  11. Storefront to Customer (sync): Shows onboarding tips