commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز 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 در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی 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