commerce

POST /v1/carts/{cartId}/checkout

Check out a cart — place and charge an order.

Semua titik akhir commerce

Pengesahan

Hantar kunci API sebagai token pembawa. Kunci tersebut mesti membawa kebenaran billing.payment.manage; kunci yang tidak mempunyainya akan ditolak dengan 403, bukan 404.

Titik akhir ini tidak memerlukan id organisasi. Kunci anda telah mengenal pasti organisasi kepunyaannya, dan respons dis skopkan kepadanya.

Cuba

Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.

curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

Sudah log masuk? Konsol API dalam papan pemuka anda mengisi id organisasi sebenar dan kunci anda sendiri, serta menjalankan permintaan terhadap API langsung supaya anda boleh melihat respons sebenar. Buka penamat ini dalam konsol API

Butiran

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`.

Parameter

NamaJenisDiperlukanApakah ia
cartId (path)UuidYaThe cart's id.
Idempotency-Key (header)stringTidakClient-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats.

Badan permintaan

NamaJenisDiperlukanApakah ia
billing_countryobjectTidakISO 3166-1 alpha-2 country for the tax jurisdiction.
availability_tokensobjectTidak`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`.

Respons

NamaJenisDiperlukanApakah ia
idUuidYaUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidYaUUIDv7 identifier — sortable by creation time (docs/02 §8).
human_refstringYaHuman-friendly order reference.
statusOrderStatusYaAn order's lifecycle state (docs/31 §4.3).
currencyCurrencyCodeYaISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
subtotal_minorintegerYa
tax_minorintegerYa
discount_minorintegerYa
total_minorintegerYa
billing_countryobjectTidak
placed_atobjectTidak
created_atstringYa
updated_atstringTidak
linesOrderLine[]Ya
paymentsPayment[]Ya

Ralat yang boleh dikembalikan oleh titik akhir ini

401 · 403 · 404 · 409 · 422 · 429