commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Autentifikatsiya
API kalitini bearer token sifatida yuboring. Kalit billing.payment.manage ruxsatiga ega boʻlishi shart; ruxsatsiz kalit 404 emas, balki 403 xatosi bilan rad etiladi.
Bu yakuniy nuqta hech qanday tashkilot identifikatorini qabul qilmaydi. Sizning kalitingiz unga tegishli tashkilotni allaqachon aniqlaydi va javob shunga qarab cheklanadi.
Sinab ko'rish
Qavslardagi har qanday narsani o'z qiymatlaringiz bilan, kalit pleysxolderini эsa boshqaruv panelingizdagi kalit bilan almashtiring.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Tizimga kirganmisiz? Boshqaruv panelingizdagi API konsoli haqiqiy tashkilot ID raqamingiz va shaxsiy kalitingizni avtomatik to'ldiradi hamda haqiqiy javobni ko'rishingiz uchun so'rovni jonli API orqali bajaradi. Ushbu yakuniy nuqtani API konsolida oching
Tafsilotlar
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`.
Parametrlar
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
cartId (path) | Uuid | Ha | The cart's id. |
Idempotency-Key (header) | string | Yo'q | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Soʻrov tanasi
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
billing_country | object | Yo'q | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Yo'q | `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`. |
Javob
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
id | Uuid | Ha | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Ha | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Ha | Human-friendly order reference. |
status | OrderStatus | Ha | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Ha | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Ha | — |
tax_minor | integer | Ha | — |
discount_minor | integer | Ha | — |
total_minor | integer | Ha | — |
billing_country | object | Yo'q | — |
placed_at | object | Yo'q | — |
created_at | string | Ha | — |
updated_at | string | Yo'q | — |
lines | OrderLine[] | Ha | — |
payments | Payment[] | Ha | — |
Ushbu yakuniy nuqta qaytarishi mumkin bo'lgan xatolar
401 · 403 · 404 · 409 · 422 · 429