commerce
POST /v1/carts/{cartId}/checkout
Check out a cart — place and charge an order.
認証
ベアラー トークンとして API キーを送信します。キーには billing.payment.manage 権限が付与されている必要があります。権限のないキーは 404 ではなく 403 で拒否されます。
このエンドポイントは組織IDを受け付けません。お使いのキーによって所属する組織がすでに特定されており、レスポンスはその組織にスコープされます。
試してみる
アングルブラケット内のすべてをご自身の値に置き換え、キーのプレースホルダーをご利用中のダッシュボードのキーに置き換えてください。
curl -X POST https://api.zinndigital.com/v1/carts/{cartId}/checkout \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'ログインしていますか?ダッシュボード内のAPIコンソールでは、実際の組織IDやお客様ご自身のキーが自動入力され、ライブ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