commerce

POST /v1/carts

Open a shopping cart.

כל נקודות הקצה מסוג commerce

אימות

שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה 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