commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
Autentifikacija
Pošaljite API ključ kao bearer token. Ključ mora imati dozvolu billing.payment.manage; ključ bez nje se odbija sa 403, a ne sa 404.
Ovaj krajnji tačka ne prihvata ID organizacije. Vaš ključ već identifikuje organizaciju kojoj pripada, a odgovor je ograničen na nju.
Isprobajte
Zamenite bilo šta u uglastim zagradama sopstvenim vrednostima, a ključni placeholder sa ključem sa vaše kontrolne table.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Prijavljeni ste? API konzola na vašoj kontrolnoj tabli automatski popunjava ID vaše stvarne organizacije i vaš sopstveni ključ, i izvršava zahtev nad API-jem uživo tako da možete videti stvarni odgovor. Otvorite ovu krajnju tačku u API konzoli
Detalji
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`.
Parametri
| Naziv | Vrsta | Obavezno | Šta je ovo |
|---|---|---|---|
cartId (path) | Uuid | Da | The cart's id. |
Idempotency-Key (header) | string | Ne | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Telo zahteva
| Naziv | Vrsta | Obavezno | Šta je ovo |
|---|---|---|---|
billing_country | object | Ne | ISO 3166-1 alpha-2 country for the tax jurisdiction. |
availability_tokens | object | Ne | `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`. |
Odgovor
| Naziv | Vrsta | Obavezno | Šta je ovo |
|---|---|---|---|
id | Uuid | Da | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Da | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | Da | Human-friendly order reference. |
status | OrderStatus | Da | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | Da | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | Da | — |
tax_minor | integer | Da | — |
discount_minor | integer | Da | — |
total_minor | integer | Da | — |
billing_country | object | Ne | — |
placed_at | object | Ne | — |
created_at | string | Da | — |
updated_at | string | Ne | — |
lines | OrderLine[] | Da | — |
payments | Payment[] | Da | — |
Greške koje ovaj krajnji tačka može da vrati
401 · 403 · 404 · 409 · 422 · 429