commerce

POST /v1/carts

Open a shopping cart.

Барлық commerce соңғы нүктелері

Аутентификация

API кілтін bearer токені ретінде жіберіңіз. Кілтте billing.payment.manage рұқсаты болуы тиіс; онсыз кілтке 404 емес, 403 қатесі қайтарылады.

Ұйымыңыздың идентификаторы орналасатын жер

Бұл соңғы нүкте JSON корпусында өріс ретінде org_id қабылдайды.

Сіздің ұйым идентификаторыңыз басқару панеліндегі 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`.

Сұрау денесі

АтыTүріМіндеттіМазмұны
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…

Жауап

АтыTүріМіндеттіМазмұны
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