commerce

POST /v1/carts

Open a shopping cart.

Alle commerce-eindpunten

Authenticatie

Stuur een API-sleutel mee als bearer token. De sleutel moet over de permissie billing.payment.manage beschikken; een sleutel zonder deze permissie wordt geweigerd met een 403 in plaats van een 404.

Waar je organisatie-id komt te staan

Dit eindpunt verwacht org_id als een veld in de JSON-body.

Uw organisatie-id staat op het scherm met API-sleutels in uw dashboard, naast de sleutel zelf. Dit is in elke aanroep die u doet dezelfde id.

Probeer het

Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw dashboard.

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

Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console

Details

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

Aanvraaglichaam

NaamTypeVerplichtWat dit is
org_idUuid | nullNeeDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringNee
currencyCurrencyCode | nullNeeThe 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…

Reactie

NaamTypeVerplichtWat dit is
idUuidJaUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidJaUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Ja
currencyCurrencyCode | nullNeeFixed 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_lineobjectNee
linesCartLine[]Ja
subtotalMoneyAmountJaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountJaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountJaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringJa
updated_atstringNee

Fouten die dit eindpunt kan retourneren

401 · 403 · 422 · 429