commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
توثيقِ شناخت
ایک بیرر ٹوکن کے طور پر ایک API کی بھیجیں۔ کی کے پاس billing.payment.manage اجازت ہونی چاہیے؛ اس کے بغیر کی کو 404 کے بجائے 403 کے ساتھ مسترد کر دیا جاتا ہے۔
یہ اینڈ پوائنٹ کوئی آرگنائزیشن آئی ڈی نہیں لیتا۔ آپ کی کلید پہلے ہی اس آرگنائزیشن کی شناخت کرتی ہے جس سے یہ تعلق رکھتی ہے، اور اس کا جواب اسی کے مطابق محدود ہوتا ہے۔
آزمائیں
کوئی بھی چیز جو زاویہ دار قوسین میں ہو اسے اپنی اقدار سے بدلیں، اور کلیدی پلیس ہولڈر کو اپنے ڈیش بورڈ کی کسی کلید سے بدلیں۔
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