commerce

POST /v1/carts

Open a shopping cart.

Всички крайни точки в commerce

Упълномощаване

Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението billing.payment.manage; ключ без него се отхвърля с 403, а не с 404.

Където отива идентификаторът на вашата организация

Този краен пункт приема org_id като поле в JSON тялото.

ИД на вашата организация се намира на екрана с API ключове във вашето табло за управление, до самия ключ. Това е същият ИД във всяко заявка, която правите.

Опитайте

Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.

curl -X POST https://api.zinndigital.com/v1/carts \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата

Детайли

Creates an empty open cart for the organization. Prices on its lines are server-authoritative and re-computed on every read (the client price is never trusted). Requires `billing.payment.manage`.

Тяло на заявката

ИмеТипЗадължителноКакво представлява
org_idUuid | nullНеDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringНе
currencyCurrencyCode | nullНеThe currency to open the basket in — what the customer will be **billed** in. Omit it and the engine uses the `X-Zinn-Currency` header the dashboard already sends, falling back…

Отговор

ИмеТипЗадължителноКакво представлява
idUuidДаUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidДаUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Да
currencyCurrencyCode | nullНеFixed when the cart is opened, from `CartCreate.currency` or the `X-Zinn-Currency` header, and then locked — every line must match it. Null only on a legacy cart created before…
product_lineobjectНе
linesCartLine[]Да
subtotalMoneyAmountДаA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountДаA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountДаA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringДа
updated_atstringНе

Грешки, които този крайpoint може да върне

401 · 403 · 422 · 429