commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Autentikasi
Kirim kunci API sebagai token bearer. Kunci tersebut harus memiliki izin billing.payment.manage; kunci tanpa izin tersebut akan ditolak dengan status 403, bukan 404.
Endpoint ini tidak memerlukan id organisasi. Kunci Anda telah mengidentifikasi organisasi tempatnya berafiliasi, dan respons akan dibatasi untuk organisasi tersebut.
Coba
Ganti apa pun di dalam tanda kurung sudut dengan nilai Anda sendiri, dan placeholder kunci dengan kunci dari dasbor Anda.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Sudah masuk? Konsol API di dasbor Anda akan mengisi ID organisasi asli dan kunci Anda sendiri, serta menjalankan permintaan terhadap API langsung sehingga Anda dapat melihat respons aktualnya. Buka titik akhir ini di konsol API
Detail
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`.
Parameter
| Nama | Jenis | Wajib | Tentang apa ini |
|---|---|---|---|
cartId (path) | Uuid | Ya | The cart's id. |
Idempotency-Key (header) | string | Tidak | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Isi permintaan
| Nama | Jenis | Wajib | Tentang apa ini |
|---|---|---|---|
billing_country | object | Tidak | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Tidak | `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`. |
Tanggapan
| Nama | Jenis | Wajib | Tentang apa ini |
|---|---|---|---|
id | Uuid | Ya | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Ya | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Ya | Human-friendly order reference. |
status | OrderStatus | Ya | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Ya | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Ya | — |
tax_minor | integer | Ya | — |
discount_minor | integer | Ya | — |
total_minor | integer | Ya | — |
billing_country | object | Tidak | — |
placed_at | object | Tidak | — |
created_at | string | Ya | — |
updated_at | string | Tidak | — |
lines | OrderLine[] | Ya | — |
payments | Payment[] | Ya | — |
Kesalahan yang dapat dikembalikan oleh titik akhir ini
401 · 403 · 404 · 409 · 422 · 429