commerce

POST /v1/carts

Open a shopping cart.

Усі кінцеві точки commerce

Автентифікація

Надішліть ключ API як маркер носія (bearer token). Ключ повинен мати дозвіл 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, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі 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Ні

Помилки, які може повертати ця кінцева точка

401 · 403 · 422 · 429