commerce

POST /v1/carts

Open a shopping cart.

همه نقاط پایانی commerce

احراز هویت

یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز billing.payment.manage باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد می‌شود، نه 404.

جایی که شناسه سازمان شما قرار می‌گیرد

این نقطه پایانی org_id را به عنوان یک فیلد در بدنه JSON دریافت می‌کند.

شناسه سازمان شما در صفحه کلیدهای API در داشبوردتان، در کنار خود کلید قرار دارد. این شناسه در تمام درخواست‌هایی که ارسال می‌کنید یکسان است.

امتحان کنید

هر چیزی را که داخل براکت‌های زاویه‌دار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.

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

بدنه درخواست

نامنوعالزامیچیست
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…

پاسخ

نامنوعالزامیچیست
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