commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Uthibitishaji
Tuma ufunguo wa API kama tokeni ya kubeba. Ufunguo lazima uwe na ruhusa ya billing.payment.manage; ufunguo usio nayo unakataliwa kwa 403, si 404.
Endpoint hii haichukui kitambulisho cha shirika. Ufunguo wako tayari unalitambua shirika linalohusika, na jibu limewekewa kikomo kwa shirika hilo pekee.
Jaribu
Badilisha chochote kilicho ndani ya mabano ya pembe na maadili yako mwenyewe, na kishikiliaji cha ufunguo na ufunguo kutoka kwa dashibodi yako.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Umeingia kwenye akaunti? Dashibodi yako ya kiweko cha API inajaza kitambulisho chako halisi cha shirika na ufunguo wako mwenyewe, na kuendesha ombi dhidi ya API ya moja kwa moja ili uweze kuona jibu halisi. Fungua sehemu hii ya mwisho (endpoint) kwenye konsole ya API
Maelezo
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`.
Vigezo
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
cartId (path) | Uuid | Ndiyo | The cart's id. |
Idempotency-Key (header) | string | Hapana | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Mwili wa ombi
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
billing_country | object | Hapana | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Hapana | `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`. |
Majibu
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
id | Uuid | Ndiyo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Ndiyo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Ndiyo | Human-friendly order reference. |
status | OrderStatus | Ndiyo | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Ndiyo | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Ndiyo | — |
tax_minor | integer | Ndiyo | — |
discount_minor | integer | Ndiyo | — |
total_minor | integer | Ndiyo | — |
billing_country | object | Hapana | — |
placed_at | object | Hapana | — |
created_at | string | Ndiyo | — |
updated_at | string | Hapana | — |
lines | OrderLine[] | Ndiyo | — |
payments | Payment[] | Ndiyo | — |
Hitilafu ambazo mwisho huu unaweza kurudisha
401 · 403 · 404 · 409 · 422 · 429