commerce

POST /v1/carts

Open a shopping cart.

Všechny koncové body commerce

Autentizace

Zašlete API klíč jako nosný token (bearer token). Klíč musí mít oprávnění billing.payment.manage; klíč bez něj je odmítnut s kódem 403, nikoli 404.

Sem patří ID vaší organizace

Tento koncový bod přijímá org_id jako pole v těle JSON.

ID vaší organizace najdete na obrazovce API klíčů ve vašem přehledu, hned vedle samotného klíče. Je to stále stejné ID v každém volání, které provedete.

Vyzvednout

Nahraďte cokoli v závorkách vlastními hodnotami a zástupný symbol klíče klíčem z vašeho řídicího panelu.

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

Přihlášeni? Konzole API ve vašem dashboardu automaticky doplní vaše skutečné ID organizace i váš vlastní klíč a odešle požadavek na živé API, abyste viděli reálnou odpověď. Otevřete tento koncový bod v konzoli API

Podrobnosti

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

Tělo požadavku

NázevTypPožadovánoCo to je
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…

Odpověď

NázevTypPožadovánoCo to je
idUuidAnoUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidAnoUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Ano
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[]Ano
subtotalMoneyAmountAnoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountAnoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountAnoA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringAno
updated_atstringNe

Chyby, které může tento koncový bod vrátit

401 · 403 · 422 · 429