Pengesahan
Hantar kunci API sebagai token pembawa. Kunci tersebut mesti membawa kebenaran billing.payment.manage; kunci yang tidak mempunyainya akan ditolak dengan 403, bukan 404.
Tempat ID organisasi anda diletakkan
Titik akhir ini mengambil org_id sebagai medan dalam kandungan JSON.
ID organisasi anda terletak pada skrin kekunci API dalam papan pemuka anda, di sebelah kekunci itu sendiri. Ia adalah ID yang sama dalam setiap panggilan yang anda buat.
Cuba
Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.
curl -X POST https://api.zinndigital.com/v1/carts \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Sudah log masuk? Konsol API dalam papan pemuka anda mengisi id organisasi sebenar dan kunci anda sendiri, serta menjalankan permintaan terhadap API langsung supaya anda boleh melihat respons sebenar. Buka penamat ini dalam konsol API
Butiran
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`.
Badan permintaan
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
org_id | Uuid | null | Tidak | Defaults to the caller's org; the caller must hold `billing.payment.manage` there. |
product_line | string | Tidak | — |
currency | CurrencyCode | null | Tidak | 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… |
Respons
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
id | Uuid | Ya | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Ya | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | string<open, checking_out, converted, abandoned, expired> | Ya | — |
currency | CurrencyCode | null | Tidak | 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_line | object | Tidak | — |
lines | CartLine[] | Ya | — |
subtotal | MoneyAmount | Ya | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
discount | MoneyAmount | Ya | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
total | MoneyAmount | Ya | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
created_at | string | Ya | — |
updated_at | string | Tidak | — |
Ralat yang boleh dikembalikan oleh titik akhir ini
401 · 403 · 422 · 429