1.2 KiB
1.2 KiB
Documenter — F-022 Checkout orchestrator with idempotency
Summary
Checkout orchestrates cart -> pricing -> inventory -> promotions -> shipping -> orders -> reservation -> payment. It owns no business data and exposes a single endpoint with idempotency_key.
Public API notes
| Route | Access | Result |
|---|---|---|
| POST /checkout | authenticated | Returns order summary, reservedVariantIds and payment intent reference |
Errors
CHECKOUT_CART_EMPTY— 409CHECKOUT_STOCK_UNAVAILABLE— 409CHECKOUT_PRICE_MISSING— 409CHECKOUT_PROMO_INVALID— 422CHECKOUT_SHIPPING_ZONE_NOT_FOUND— 422CHECKOUT_RESERVATION_FAILED— 409CHECKOUT_IDEMPOTENCY_CONFLICT— 409
Idempotency
idempotencyKeyis required.- Reusing the same
(userId, idempotencyKey)returns the existing order without re-reserving stock or creating a new payment intent.
Metrics
checkout_success_totalincrements on successful checkout.checkout_failure_totalincrements on any 4xx/5xx checkout error.
Evidence
work/artifacts/F-022/architect.mdwork/artifacts/F-022/implementer.mdwork/artifacts/F-022/reviewer.jsonwork/artifacts/F-022/security.jsonwork/artifacts/F-022/qa.json