commerce
POST /v1/carts
Open a shopping cart.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу billing.payment.manage; кључ без ње се одбија уз 403, а не 404.
Где се уноси ID ваше организације
Ова крајња тачка узима 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 конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом 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_id | Uuid | null | Не | Defaults to the caller's org; the caller must hold billing.payment.manage there. |
product_line | string | Не | — |
currency | CurrencyCode | 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 to… |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | Uuid | Да | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Да | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | string<open, checking_out, converted, abandoned, expired> | Да | — |
currency | CurrencyCode | 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_line | object | Не | — |
lines | CartLine[] | Да | — |
subtotal | MoneyAmount | Да | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
discount | MoneyAmount | Да | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
total | MoneyAmount | Да | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
created_at | string | Да | — |
updated_at | string | Не | — |
Грешке које ова крајња тачка може вратити
401 · 403 · 422 · 429