commerce

POST /v1/carts/{cartId}/checkout

Check out a cart — place and charge an order.

Todos os endpoints de commerce

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

NomeTipoObrigatórioO que é
cartId (path)UuidSimThe cart's id.
Idempotency-Key (header)stringNãoClient-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

NomeTipoObrigatórioO que é
billing_countryobjectNãoISO 3166-1 alpha-2 country for the tax jurisdiction.
availability_tokensobjectNã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

NomeTipoObrigatórioO que é
idUuidSimUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidSimUUIDv7 identifier — sortable by creation time (docs/02 §8).
human_refstringSimHuman-friendly order reference.
statusOrderStatusSimAn order's lifecycle state (docs/31 §4.3).
currencyCurrencyCodeSimISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
subtotal_minorintegerSim
tax_minorintegerSim
discount_minorintegerSim
total_minorintegerSim
billing_countryobjectNão
placed_atobjectNão
created_atstringSim
updated_atstringNão
linesOrderLine[]Sim
paymentsPayment[]Sim

Erros que este endpoint pode retornar

401 · 403 · 404 · 409 · 422 · 429