commerce

POST /v1/carts/{cartId}/checkout

Check out a cart — place and charge an order.

Բոլոր commerce վերջնակետերը

Նույնականացում

Ուղարկեք API բանալին որպես bearer token: Բանալին պետք է ունենա billing.payment.manage թույլտվությունը. առանց դրա բանալին մերժվում է 403, և ոչ թե 404 կարգավիճակով:

Այս վերջնակետը կազմակերպության 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_countryobjectՈչISO 3166-1 alpha-2 country for the tax jurisdiction.
availability_tokensobjectՈչ`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`.

Պատասխան

ԱնունՏեսակՊահանջվում էԻնչ է դա
idUuidԱյոUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidԱյոUUIDv7 identifier — sortable by creation time (docs/02 §8).
human_refstringԱյոHuman-friendly order reference.
statusOrderStatusԱյոAn order's lifecycle state (docs/31 §4.3).
currencyCurrencyCodeԱյոISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8).
subtotal_minorintegerԱյո
tax_minorintegerԱյո
discount_minorintegerԱյո
total_minorintegerԱյո
billing_countryobjectՈչ
placed_atobjectՈչ
created_atstringԱյո
updated_atstringՈչ
linesOrderLine[]Այո
paymentsPayment[]Այո

Այս վերջնակետի կողմից վերադարձվող սխալները

401 · 403 · 404 · 409 · 422 · 429