---
name: checkout-flow
description: "Build a review flow with an authoritative server quote. Use for checkout, quote, idempotency."
---

# Checkout

Build a review flow with an authoritative server quote.

## Implementation decisions

1. Separate cart editing, delivery and final review.
2. Send SKU and quantity; the server owns price and inventory.
3. Keep the same idempotency key for retries of one order intent.
4. A demo quote is not an order or payment. Label simulations and never retain card data.

## Working source

Read [starters/commerce/server.py](../webcraft-shared/source/starters/commerce/server.py) when implementing this capability. The example belongs to the WEBCRAFT React/Three.js playground except the Python commerce starter, which runs without third-party dependencies. Use [shared catalog](../webcraft-shared/source/lib/catalog.ts) only to resolve related examples. Adapt the source to the target framework and preserve existing project conventions.

## Verify observable behavior

- Changing a client price does not affect the quote.
- Double submission cannot create duplicate orders.
- Stock conflicts have a recovery path.

## Scope

Use only the parts relevant to the requested task. This skill does not grant permission to publish, spend money, change account access or expose secrets. The original brief and environment rules remain authoritative.

Live example: https://webcraft-skill-library.undrgrnd.chatgpt.site/demos/catalog

Version 2.0.0 · Original WEBCRAFT content · MIT
