commerce

POST /v1/carts

Open a shopping cart.

Semua titik akhir commerce

Autentikasi

Kirim kunci API sebagai token bearer. Kunci tersebut harus memiliki izin billing.payment.manage; kunci tanpa izin tersebut akan ditolak dengan status 403, bukan 404.

Tempat ID organisasi Anda dimasukkan

Titik akhir ini memerlukan org_id sebagai field dalam bodi JSON.

ID organisasi Anda berada di layar kunci API di dasbor Anda, di sebelah kunci itu sendiri. Itu adalah ID yang sama dalam setiap panggilan yang Anda buat.

Coba

Ganti apa pun di dalam tanda kurung sudut dengan nilai Anda sendiri, dan placeholder kunci dengan kunci dari dasbor Anda.

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

Sudah masuk? Konsol API di dasbor Anda akan mengisi ID organisasi asli dan kunci Anda sendiri, serta menjalankan permintaan terhadap API langsung sehingga Anda dapat melihat respons aktualnya. Buka titik akhir ini di konsol API

Detail

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

Isi permintaan

NamaJenisWajibTentang apa ini
org_idUuid | nullTidakDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringTidak
currencyCurrencyCode | nullTidakThe 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…

Tanggapan

NamaJenisWajibTentang apa ini
idUuidYaUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidYaUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Ya
currencyCurrencyCode | nullTidakFixed 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_lineobjectTidak
linesCartLine[]Ya
subtotalMoneyAmountYaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountYaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountYaA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringYa
updated_atstringTidak

Kesalahan yang dapat dikembalikan oleh titik akhir ini

401 · 403 · 422 · 429