commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Pagpapatotoo
Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na billing.payment.manage; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.
Ang endpoint na ito ay hindi nangangailangan ng id ng organisasyon. Natutukoy na ng iyong key ang organisasyong kinabibilangan nito, at nakatuon ang tugon dito.
Subukan ito
Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API
Mga Detalye
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`.
Mga Parameter
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
cartId (path) | Uuid | Oo | The cart's id. |
Idempotency-Key (header) | string | Hindi | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Katawan ng kahilingan
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
billing_country | object | Hindi | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Hindi | `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`. |
Tugon
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
id | Uuid | Oo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Oo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Oo | Human-friendly order reference. |
status | OrderStatus | Oo | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Oo | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Oo | — |
tax_minor | integer | Oo | — |
discount_minor | integer | Oo | — |
total_minor | integer | Oo | — |
billing_country | object | Hindi | — |
placed_at | object | Hindi | — |
created_at | string | Oo | — |
updated_at | string | Hindi | — |
lines | OrderLine[] | Oo | — |
payments | Payment[] | Oo | — |
Mga error na maibabalik ng endpoint na ito
401 · 403 · 404 · 409 · 422 · 429