Opening the shared document…
Diagram playground
Write a diagram as text and it renders here as you type. Canvas editing for six of ten notations. Nothing leaves your browser. Syntax reference ·
1
archlab 1.0 sequence
2
title "Checkout — Place Order"
3
description "One order placed: card charged, order stored, receipt sent."
4
5
@sequence
6
autonumber
7
cust:actor "Customer"
8
web "Storefront" [Next.js]
9
api:participant "Order API" [Go]
10
pay:participant "Payments" [Stripe]
11
db:participant "Orders DB" [PostgreSQL]
12
13
cust -> web : "Clicks Place order"
14
web ->+ api : "Place the order" [HTTPS]
15
desc "POST /api/v1/orders\nbody { cartId, addressId }\n201 → { orderId }\n409 → the cart moved on"
16
api -> api : "Validates the cart"
17
note right api : "Price and stock re-checked server-side"
18
alt "card accepted"
19
api ->+ pay : "Create charge" [REST]
20
desc "curl https://api.payments.example/v1/charges \\\n --request POST \\\n --header 'Idempotency-Key: <order id>' \\\n --data '{ \"amount\": 4250, \"currency\": \"THB\" }'\n\nThe idempotency key is the order id, so a retry cannot double-charge."
21
pay ..>- api : "charge.succeeded"
22
api -> db : "INSERT order" [SQL]
23
par "receipt"
24
api ~> cust : "Emails the receipt"
25
and "audit"
26
api ~> db : "Writes audit row"
27
api ..>- web : "201 Created"
28
else "card declined"
29
api ..> web : "402 Payment Required"
30
opt "first purchase"
31
web -> cust : "Shows onboarding tips"
32
note over cust db : "Order flow complete"
Tab indents · Esc then Tab leaves the editor · syntax reference
Read-only
- Customer to Storefront (solid line with an arrowhead): Clicks Place order
- Storefront to Order API (solid line with an arrowhead): Place the order [HTTPS]
- Order API to Order API (solid line with an arrowhead, self-message): Validates the cart
- Order API to Payments (solid line with an arrowhead): Create charge [REST]
- Payments to Order API (dotted line with an arrowhead): charge.succeeded
- Order API to Orders DB (solid line with an arrowhead): INSERT order [SQL]
- Order API to Customer (solid line with an open head): Emails the receipt
- Order API to Orders DB (solid line with an open head): Writes audit row
- Order API to Storefront (dotted line with an arrowhead): 201 Created
- Order API to Storefront (dotted line with an arrowhead): 402 Payment Required
- Storefront to Customer (solid line with an arrowhead): Shows onboarding tips