commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
प्रमाणीकरण
एपिआई कुञ्जीलाई बियरर टोकन (bearer token) को रूपमा पठाउनुहोस्। कुञ्जीसँग 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