commerce

POST /v1/carts

Open a shopping cart.

جميع نقاط نهاية commerce

المصادقة

أرسل مفتاح واجهة برمجة التطبيقات (API key) كرمز حامل (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

التفاصيل

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