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