commerce

POST /v1/carts

Open a shopping cart.

Բոլոր commerce վերջնակետերը

Նույնականացում

Ուղարկեք API բանալին որպես bearer token: Բանալին պետք է ունենա billing.payment.manage թույլտվությունը. առանց դրա բանալին մերժվում է 403, և ոչ թե 404 կարգավիճակով:

Որտեղ տեղադրվում է ձեր կազմակերպության ID-ն

Այս վերջնակետը JSON մարմնում որպես դաշտ վերցնում է org_id-ը։

Ձեր կազմակերպության ID-ն գտնվում է Ձեր ղեկավարման վահանակի API բանալիների էկրանին՝ բուն բանալու կողքին: Այն նույն ID-ն է Ձեր կատարած յուրաքանչյուր հարցման մեջ:

Փորձել

Փոխարինեք անկյունային փակագծերում գտնվող ցանկացած բան ձեր սեփական արժեքներով, և բանալու տեղապահը՝ ձեր վահանակի բանալիով:

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_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