commerce

POST /v1/carts

Open a shopping cart.

Svi commerce krajnji točke

Autentifikacija

Pošaljite API ključ kao nosivi token. Ključ mora imati dozvolu billing.payment.manage; ključ bez nje se odbija s kodom 403, a ne 404.

Gdje dolazi ID vaše organizacije

Ova krajnja točka prihvaća org_id kao polje u JSON tijelu.

ID vaše organizacije nalazi se na zaslonu API ključeva u vašoj nadzornoj ploči, pored samog ključa. To je isti ID u svakom pozivu koji uputite.

Isprobajte

Zamijenite sve unutar šiljastih zagrada svojim vlastitim vrijednostima, a rezervirano mjesto za ključ s ključem iz vaše nadzorne ploče.

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

Prijavljeni ste? API konzola na vašoj nadzornoj ploči automatski unosi stvarni ID vaše organizacije i vaš vlastiti ključ te šalje zahtjev prema aktivnom API-ju kako biste mogli vidjeti stvarni odgovor. Otvori ovu krajnju točku u API konzoli

Pojedinosti

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

Tijelo zahtjeva

NazivVrstaObaveznoŠto je to
org_idUuid | nullNeDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringNe
currencyCurrencyCode | nullNeThe 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…

Odgovor

NazivVrstaObaveznoŠto je to
idUuidDaUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidDaUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Da
currencyCurrencyCode | nullNeFixed 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_lineobjectNe
linesCartLine[]Da
subtotalMoneyAmountDaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountDaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountDaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringDa
updated_atstringNe

Pogreške koje ova krajnja točka može vratiti

401 · 403 · 422 · 429