commerce

POST /v1/carts/{cartId}/checkout

Check out a cart — place and charge an order.

Todos los endpoints de commerce

Autenticación

Envía una clave de API como token de portador. La clave debe tener el permiso billing.payment.manage; una clave que no lo tenga se rechazará con un código 403, no 404.

Este endpoint no requiere ningún id de organización. Su clave ya identifica la organización a la que pertenece, y la respuesta está delimitada a ella.

Pruébalo

Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.

curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API

Detalles

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

NombreTipoObligatorio¿Qué es esto?
cartId (path)UuidThe cart's id.
Idempotency-Key (header)stringNoClient-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats.

Cuerpo de la solicitud

NombreTipoObligatorio¿Qué es esto?
billing_countryobjectNoISO 3166-1 alpha-2 country for the tax jurisdiction.
availability_tokensobjectNo`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`.

Respuesta

NombreTipoObligatorio¿Qué es esto?
idUuidUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidUUIDv7 identifier — sortable by creation time (docs/02 §8).
human_refstringHuman-friendly order reference.
statusOrderStatusAn order's lifecycle state (docs/31 §4.3).
currencyCurrencyCodeISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
subtotal_minorinteger
tax_minorinteger
discount_minorinteger
total_minorinteger
billing_countryobjectNo
placed_atobjectNo
created_atstring
updated_atstringNo
linesOrderLine[]
paymentsPayment[]

Errores que este endpoint puede devolver

401 · 403 · 404 · 409 · 422 · 429