commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Autenticação
Envie uma chave de API como um token de portador. A chave deve ter a permissão billing.payment.manage; uma chave sem ela é recusada com 403, e não 404.
Este endpoint não requer um ID de organização. Sua chave já identifica a organização à qual pertence, e a resposta é delimitada a ela.
Experimente
Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API
Detalhes
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`.
Parâmetros
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
cartId (path) | Uuid | Sim | The cart's id. |
Idempotency-Key (header) | string | Não | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Corpo da requisição
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
billing_country | object | Não | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Não | `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`. |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
id | Uuid | Sim | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Sim | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Sim | Human-friendly order reference. |
status | OrderStatus | Sim | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Sim | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Sim | — |
tax_minor | integer | Sim | — |
discount_minor | integer | Sim | — |
total_minor | integer | Sim | — |
billing_country | object | Não | — |
placed_at | object | Não | — |
created_at | string | Sim | — |
updated_at | string | Não | — |
lines | OrderLine[] | Sim | — |
payments | Payment[] | Sim | — |
Erros que este endpoint pode retornar
401 · 403 · 404 · 409 · 422 · 429