commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Doğrulama
API açarını bearer token kimi göndərin. Açar billing.payment.manage icazəsinə malik olmalıdır; bu icazəsi olmayan açar 404 deyil, 403 xətası ilə rədd edilir.
Bu endpoint heç bir təşkilat ID-si tələb etmir. Sizin açarınız artıq aid olduğu təşkilatı müəyyən edir və cavab həmin təşkilat üçün məhdudlaşdırılır.
Sınaqdan keçir
Bucaqlı mötərizələrdə olan hór şeyi öz qiymətlərinizlə, açar yertutucusunu isə idarə panelinizdən bir açarla əvəz edin.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Sistemə daxil olmusunuz? İdarə panelinizdəki API konsolu real təşkilatınızın identifikatorunu və öz açarınızı avtomatik doldurur, sorğunu canlı API-yə qarşı icra edir ki, siz faktiki cavabı görə biləsiniz. Bu son nöqtəni API konsolunda açın
Təfərrüatlar
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`.
Parametrlər
| Ad | Tip | Tələb olunur | Nədir |
|---|---|---|---|
cartId (path) | Uuid | Bəli | The cart's id. |
Idempotency-Key (header) | string | Xeyr | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Sorğu gövdəsi
| Ad | Tip | Tələb olunur | Nədir |
|---|---|---|---|
billing_country | object | Xeyr | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Xeyr | `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`. |
Cavab
| Ad | Tip | Tələb olunur | Nədir |
|---|---|---|---|
id | Uuid | Bəli | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Bəli | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Bəli | Human-friendly order reference. |
status | OrderStatus | Bəli | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Bəli | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Bəli | — |
tax_minor | integer | Bəli | — |
discount_minor | integer | Bəli | — |
total_minor | integer | Bəli | — |
billing_country | object | Xeyr | — |
placed_at | object | Xeyr | — |
created_at | string | Bəli | — |
updated_at | string | Xeyr | — |
lines | OrderLine[] | Bəli | — |
payments | Payment[] | Bəli | — |
Bu son nöqtənin qaytara biləcəyi xətalar
401 · 403 · 404 · 409 · 422 · 429