commerce

POST /v1/carts/{cartId}/checkout

Check out a cart — place and charge an order.

Усі кінцеві точки commerce

Автентифікація

Надішліть ключ API як маркер носія (bearer token). Ключ повинен мати дозвіл billing.payment.manage; ключ без нього відхиляється з кодом 403, а не 404.

Цей кінцевий пункт не потребує ідентифікатора організації. Ваш ключ уже ідентифікує організацію, якій він належить, і відповідь обмежується її межами.

Спробувати

Замініть усе в кутових дужках власними значеннями, а заповнювач ключа — ключем із вашої панелі керування.

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

Увійшли в систему? Консоль API у вашій панелі керування автоматично підставляє ваш реальний ідентифікатор організації та ваш власний ключ, а також виконує запит до робочого API, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі API

Деталі

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`.

Параметри

НазваТипОбов'язковеЩо це таке
cartId (path)UuidТакThe cart's id.
Idempotency-Key (header)stringНіClient-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats.

Тіло запиту

НазваТипОбов'язковеЩо це таке
billing_countryobjectНіISO 3166-1 alpha-2 country for the tax jurisdiction.
availability_tokensobjectНі`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`.

Відповідь

НазваТипОбов'язковеЩо це таке
idUuidТакUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidТакUUIDv7 identifier — sortable by creation time (docs/02 §8).
human_refstringТакHuman-friendly order reference.
statusOrderStatusТакAn order's lifecycle state (docs/31 §4.3).
currencyCurrencyCodeТакISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
subtotal_minorintegerТак
tax_minorintegerТак
discount_minorintegerТак
total_minorintegerТак
billing_countryobjectНі
placed_atobjectНі
created_atstringТак
updated_atstringНі
linesOrderLine[]Так
paymentsPayment[]Так

Помилки, які може повертати ця кінцева точка

401 · 403 · 404 · 409 · 422 · 429