commerce

POST /v1/carts

Open a shopping cart.

Lahat ng commerce endpoint

Pagpapatotoo

Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na billing.payment.manage; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.

Kung saan mapupunta ang id ng iyong organisasyon

Ang endpoint na ito ay kumukuha ng org_id bilang isang field sa JSON body.

Ang id ng iyong organisasyon ay nasa screen ng mga API key sa iyong dashboard, sa tabi mismo ng key. Ito ang parehong id sa bawat tawag na gagawin mo.

Subukan ito

Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.

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

Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API

Mga Detalye

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

Katawan ng kahilingan

PangalanUriKailanganAno ito
org_idUuid | nullHindiDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringHindi
currencyCurrencyCode | nullHindiThe 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…

Tugon

PangalanUriKailanganAno ito
idUuidOoUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidOoUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Oo
currencyCurrencyCode | nullHindiFixed 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_lineobjectHindi
linesCartLine[]Oo
subtotalMoneyAmountOoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountOoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountOoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringOo
updated_atstringHindi

Mga error na maibabalik ng endpoint na ito

401 · 403 · 422 · 429