commerce

POST /v1/carts

Open a shopping cart.

Vituo vyote vya commerce

Uthibitishaji

Tuma ufunguo wa API kama tokeni ya kubeba. Ufunguo lazima uwe na ruhusa ya billing.payment.manage; ufunguo usio nayo unakataliwa kwa 403, si 404.

Mahali ambapo kitambulisho cha shirika lako huwekwa

Sehemu hii ya mwisho inachukua org_id kama uwanja katika mwili wa JSON.

Kitambulisho cha shirika lako kipo kwenye skrini ya funguo za API katika dashibodi yako, kando ya ufunguo wenyewe. Ni kitambulisho kile kile katika kila ombi unalofanya.

Jaribu

Badilisha chochote kilicho ndani ya mabano ya pembe na maadili yako mwenyewe, na kishikiliaji cha ufunguo na ufunguo kutoka kwa dashibodi yako.

curl -X POST https://api.zinndigital.com/v1/carts \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

Umeingia kwenye akaunti? Dashibodi yako ya kiweko cha API inajaza kitambulisho chako halisi cha shirika na ufunguo wako mwenyewe, na kuendesha ombi dhidi ya API ya moja kwa moja ili uweze kuona jibu halisi. Fungua sehemu hii ya mwisho (endpoint) kwenye konsole ya API

Maelezo

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`.

Mwili wa ombi

JinaAinaInayohitajikaKilicho hiki
org_idUuid | nullHapanaDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringHapana
currencyCurrencyCode | nullHapanaThe 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…

Majibu

JinaAinaInayohitajikaKilicho hiki
idUuidNdiyoUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidNdiyoUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Ndiyo
currencyCurrencyCode | nullHapanaFixed 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_lineobjectHapana
linesCartLine[]Ndiyo
subtotalMoneyAmountNdiyoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountNdiyoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountNdiyoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringNdiyo
updated_atstringHapana

Hitilafu ambazo mwisho huu unaweza kurudisha

401 · 403 · 422 · 429