commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (API key) كرمز حامل (bearer token). يجب أن يحمل المفتاح إذن billing.payment.manage؛ والمفتاح الذي لا يملكه يُرفض بالرمز 403 وليس 404.
لا يقبل هذا الطرف أي معرف للمؤسسة. يحدد مفتاحك بالفعل المؤسسة التي ينتمي إليها، وتكون الاستجابة محصورة في نطاقها.
جربه الآن
استبدل أي شيء بين أقواس زاوية بقيمك الخاصة، والعنصر النائب للمفتاح بمفتاح من لوحة تحكمك.
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'هل سجلت الدخول؟ تقوم وحدة تحكم واجهة برمجة التطبيقات في لوحة التحكم الخاصة بك بربط معرف مؤسستك الحقيقي ومفتاحك الخاص، وتنفذ الطلب مقابل واجهة برمجة التطبيقات المباشرة لتتمكن من رؤية الاستجابة الفعلية. افتح هذه النهاية الطرفية في وحدة تحكم 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