commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Hitelesítés
Küldjön egy API-kulcsot bearer tokenként. A kulcsnak rendelkeznie kell a(z) billing.payment.manage jogosultsággal; az ezzel nem rendelkező kulcsok esetén a rendszer 403-as hibát ad vissza 404 helyett.
Ez a végpont nem fogad el szervezeti azonosítót. Az Ön kulcsa már azonosítja azt a szervezetet, amelyhez tartozik, és a válasz is erre vonatkozik.
Próbálja ki
Cserélje ki a hegyes zárójelek közötti részt a saját értékeivel, a kulcshelyőrzőt pedig a vezérlőpultján található kulccsal.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Be van jelentkezve? A vezérlőpultban lévő API-konzol kitölti a valós szervezetazonosítóját és a saját kulcsát, és a kérést az éles API-n futtatja, hogy láthassa a tényleges választ. Nyissa meg ezt a végpontot az API konzolban
Részletek
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.
Paraméterek
| Név | Típus | Kötelező | Mi ez |
|---|---|---|---|
cartId (path) | Uuid | Igen | The cart's id. |
Idempotency-Key (header) | string | Nem | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Kérés törzse
| Név | Típus | Kötelező | Mi ez |
|---|---|---|---|
billing_country | object | Nem | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Nem | 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. |
gateway | object | Nem | The payment rail the customer chose at checkout — one of the codes getPaymentOptions returned for this organization and currency. Omit it and the order is charged wallet-first… |
expected_total_minor | object | Nem | The order total the checkout page displayed to the customer, in minor units. Send it and checkout refuses with 422 when the basket no longer comes to that figure; omit it… |
Válasz
| Név | Típus | Kötelező | Mi ez |
|---|---|---|---|
id | Uuid | Igen | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Igen | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Igen | Human-friendly order reference. |
status | OrderStatus | Igen | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Igen | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Igen | — |
tax_minor | integer | Igen | — |
discount_minor | integer | Igen | — |
total_minor | integer | Igen | — |
billing_country | object | Nem | — |
placed_at | object | Nem | — |
created_at | string | Igen | — |
updated_at | string | Nem | — |
lines | OrderLine[] | Igen | — |
payments | Payment[] | Igen | — |
Hibák, amelyeket ez a végpont visszaadhattatlan
401 · 403 · 404 · 409 · 422 · 429