commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Autenticazione
Invia una chiave API come token di tipo bearer. La chiave deve disporre dell'autorizzazione billing.payment.manage; una chiave sprovvista di tale autorizzazione viene rifiutata con 403 anziché 404.
Questo endpoint non richiede alcun ID organizzazione. La tua chiave identifica già l'organizzazione a cui appartiene e la risposta è limitata ad essa.
Provalo
Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua dashboard.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API
Dettagli
Converts the cart to an **immutable order**: re-prices every line, re-verifies each domain availability token (a stale/taken one is a `409`, with no charge), computes tax, places the order and charges it **wallet-first**. Fulfilment (provisioning/registration) then runs asynchronously as a Temporal workflow — this call never blocks on it (§2.9); poll the order `status` or the resource it produces. An **`Idempotency-Key` header is required**: a retried checkout returns the same order and never charges twice. Requires `billing.payment.manage`.
Parametri
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
cartId (path) | Uuid | Sì | The cart's id. |
Idempotency-Key (header) | string | No | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Corpo della richiesta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
billing_country | object | No | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | No | `domain_name` → the availability token issued by the domain search endpoint. Required for every `domain_register` line; each is re-verified at checkout and a stale one is a `409`. |
Risposta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
id | Uuid | Sì | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Sì | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Sì | Human-friendly order reference. |
status | OrderStatus | Sì | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Sì | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Sì | — |
tax_minor | integer | Sì | — |
discount_minor | integer | Sì | — |
total_minor | integer | Sì | — |
billing_country | object | No | — |
placed_at | object | No | — |
created_at | string | Sì | — |
updated_at | string | No | — |
lines | OrderLine[] | Sì | — |
payments | Payment[] | Sì | — |
Errori che questo endpoint può restituire
401 · 403 · 404 · 409 · 422 · 429