commerce

POST /v1/carts

Open a shopping cart.

Όλα τα τελικά σημεία commerce

Πισtoποίηση

Στείλτε ένα κλειδί API ως διακριτικό φορέα (bearer token). Το κλειδί πρέπει να διαθέτει το δικαίωμα billing.payment.manage· ένα κλειδί που δεν το διαθέτει απορρίπτεται με 403, όχι 404.

Πού μπαίνει το αναγνωριστικό του οργανισμού σας

Αυτό το endpoint δέχεται το πεδίο org_id στο σώμα JSON.

Το αναγνωριστικό του οργανισμού σας βρίσκεται στην οθόνη των κλειδιών API στον πίνακα ελέγχου σας, δίπλα στο ίδιο το κλειδί. Είναι το ίδιο αναγνωριστικό σε κάθε κλήση που πραγματοποιείτε.

Δοκιμάστε το

Ατικatastήstε ό,τι βρίskεtai μέσα σe γώniaδeς μe τis δikές sas timές, kai to placeholder klεidioύ μe éna klεidi apó ton pinaka ελέgchou sas.

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

Συνδεθήκατε; Η κονσόλα API στον πίνακα ελέγχου σας συμπληρώνει το πραγματικό αναγνωριστικό του οργανισμού σας και το δικό σας κλειδί, και εκτελεί το αίτημα στο ζωντανό API, ώστε να μπορείτε να δείτε την πραγματική απόκριση. Ανοίξτε αυτό το τελικό σημείο στην κονσόλα API

Λεπτομέρειες

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

Σώμα αίτησης

ΌνομαΤύpοςΥποχρεωτικόΤι είναι
org_idUuid | nullΌχιDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringΌχι
currencyCurrencyCode | nullΌχιThe 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…

Απάντηση

ΌνομαΤύpοςΥποχρεωτικόΤι είναι
idUuidΝαιUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidΝαιUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Ναι
currencyCurrencyCode | nullΌχιFixed 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_lineobjectΌχι
linesCartLine[]Ναι
subtotalMoneyAmountΝαιA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountΝαιA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountΝαιA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringΝαι
updated_atstringΌχι

Σφάλματα που μπορεί να επιστρέψει αυτό το τελικό σημείο

401 · 403 · 422 · 429