commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Autentifikimi
Drgoni një çelës API si një token mbajtës. Çelësi duhet të ketë lejen billing.payment.manage; një çelës pa të refuzohet me 403, jo 404.
Ky pikëndalim nuk pranon id të organizatës. Çelësi juaj tashmë identifikon organizatën së cilës i përket dhe përgjigjja kufizohet vetëm për atë.
Provoje
Zëvendësoni çdo gjë brenda kllapave këndore me vlerat tuaja dhe vendbanuesin e çelësit me një çelës nga paneli juaj.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Jeni kyçur? Konsola e API-së në panelin tuaj plotëson ID-në tuaj reale të organizatës dhe çelësin tuaj, dhe ekzekuton kërkesën kundrejt API-së live, kështu që ju mund të shihni përgjigjen aktuale. Hapni këtë pikë fundore në konsolën e API-së
Detajet
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`.
Parametrat
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
cartId (path) | Uuid | Po | The cart's id. |
Idempotency-Key (header) | string | Jo | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Trupi i kërkesës
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
billing_country | object | Jo | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Jo | `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`. |
Përgjigja
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
id | Uuid | Po | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Po | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Po | Human-friendly order reference. |
status | OrderStatus | Po | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Po | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Po | — |
tax_minor | integer | Po | — |
discount_minor | integer | Po | — |
total_minor | integer | Po | — |
billing_country | object | Jo | — |
placed_at | object | Jo | — |
created_at | string | Po | — |
updated_at | string | Jo | — |
lines | OrderLine[] | Po | — |
payments | Payment[] | Po | — |
Gabimet që ky pikëndalim mund të kthejë
401 · 403 · 404 · 409 · 422 · 429