Checkout API
REST contract of the checkout bounded context of the digital storefront, derived from storefront/model/model.yaml (contexts[checkout].rest) and the final model-gap decisions H1-H10. Checkout is the purchase saga: OPEN -> AUTHORIZING -> PLACING -> COMPLETED, with DECLINED (another token may be tried while the price quote is valid), REQUOTE_REQUIRED and FAILED (both carry a void that is retried until it succeeds), and EXPIRED (from OPEN or DECLINED). Authorize before placing (compensatable: void), place the order through customer-ordering POST /checkout (the pivot, via an Anti-Corruption Layer), then retriable steps via events. PLACING is the semantic lock: while the place-order outcome is unknown there is no void and no new attempt; the session answers 202 and the BFF polls. The session stores shopperId and shipToAddressId references, never PII, and the stored placement request is PII-free so ResolveInDoubtPlacements can replay it byte for byte with the same Idempotency-Key (alert at 20 h, give up and void at 22 h, before the network's 24 h idempotency window). Errors are RFC 9457 problem details (application/problem+json) whose type is /problems/<slug>; shared types are not-found (404), illegal-transition (409), concurrent-update (409) and validation-failed (422), plus one kebab-case slug per Err of the model. Every POST takes an Idempotency-Key header (1-128 printable ASCII characters): a missing or malformed key is 400 idempotency-key-required / idempotency-key-invalid, a repeat of the same method, path and body replays the stored answer for 24 hours with the response header Idempotency-Replayed: true, and the same key on a different request whose answer was stored is 409 idempotency-key-reused. A 2xx is stored; so is a refusal that is final for the request (malformed-request, session-closed, price-quote-expired) or that committed state (authorization-mismatch: the session was saved DECLINED before the answer). A refusal that a retry can pass is NOT stored and its key is released, so the same Idempotency-Key runs the request again and another body under it is a new request: not-found, cart-not-checkout-ready, placement-in-doubt, void-pending, concurrent-update, illegal-transition, offer-not-quotable, validation-failed and price-quote-rejected, like every 5xx (never stored). The Idempotency-Key is global to the service, not per route. A request body over 64 KiB, malformed JSON, an unknown field or a NUL character (U+0000) in the query string or body is 400 malformed-request; a NUL in the path, or a path identifier longer than 128 characters, is 404. Every error body carries type, title, status, detail and instance. No authentication.
Contact checkout maintainers: