commerce

POST /v1/carts

Open a shopping cart.

Wszystkie punkty końcowe commerce

Uwierzytelnianie

Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie billing.payment.manage; klucz bez niego jest odrzucany z kodem 403, a nie 404.

Miejsce na identyfikator organizacji

Ten punkt końcowy przyjmuje org_id jako pole w treści JSON.

Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

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

Treść żądania

NazwaTypWymaganeCo to jest
org_idUuid | nullNieDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringNie
currencyCurrencyCode | nullNieThe 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…

Odpowiedź

NazwaTypWymaganeCo to jest
idUuidTakUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidTakUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Tak
currencyCurrencyCode | nullNieFixed 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_lineobjectNie
linesCartLine[]Tak
subtotalMoneyAmountTakA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountTakA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountTakA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringTak
updated_atstringNie

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 422 · 429