commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Նույնականացում
Ուղարկեք API բանալին որպես bearer token: Բանալին պետք է ունենա billing.payment.manage թույլտվությունը. առանց դրա բանալին մերժվում է 403, և ոչ թե 404 կարգավիճակով:
Այս վերջնակետը կազմակերպության ID չի ընդունում: Ձեր բանալին արդեն իսկ նույնականացնում է այն կազմակերպությունը, որին պատկանում է, և պատասխանը սահմանափակված է դրանով:
Փորձել
Փոխարինեք անկյունային փակագծերում գտնվող ցանկացած բան ձեր սեփական արժեքներով, և բանալու տեղապահը՝ ձեր վահանակի բանալիով:
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Մուտք գործե՞լ եք: Ձեր վահանակի API վահանակը լրացնում է ձեր իրական կազմակերպության ID-ն և ձեր սեփական բանալին և գործարկում է հարցումը ուղիղ API-ի դեմ, որպեսզի կարողանաք տեսնել փաստացի պատասխանը: Բացեք այս վերջնակետը API վահանակում
Մանրամասներ
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`.
Պարամետրեր
| Անուն | Տեսակ | Պահանջվում է | Ինչ է դա |
|---|---|---|---|
cartId (path) | Uuid | Այո | The cart's id. |
Idempotency-Key (header) | string | Ոչ | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Հարցման մարմին
| Անուն | Տեսակ | Պահանջվում է | Ինչ է դա |
|---|---|---|---|
billing_country | object | Ոչ | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Ոչ | `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`. |
Պատասխան
| Անուն | Տեսակ | Պահանջվում է | Ինչ է դա |
|---|---|---|---|
id | Uuid | Այո | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Այո | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Այո | Human-friendly order reference. |
status | OrderStatus | Այո | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Այո | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Այո | — |
tax_minor | integer | Այո | — |
discount_minor | integer | Այո | — |
total_minor | integer | Այո | — |
billing_country | object | Ոչ | — |
placed_at | object | Ոչ | — |
created_at | string | Այո | — |
updated_at | string | Ոչ | — |
lines | OrderLine[] | Այո | — |
payments | Payment[] | Այո | — |
Այս վերջնակետի կողմից վերադարձվող սխալները
401 · 403 · 404 · 409 · 422 · 429