المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (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_id | Uuid | null | لا | Defaults to the caller's org; the caller must hold `billing.payment.manage` there. |
product_line | string | لا | — |
currency | CurrencyCode | 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… |
الاستجابة
| الاسم | النوع | مطلوب | ما هو هذا |
|---|---|---|---|
id | Uuid | نعم | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | نعم | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | string<open, checking_out, converted, abandoned, expired> | نعم | — |
currency | CurrencyCode | 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_line | object | لا | — |
lines | CartLine[] | نعم | — |
subtotal | MoneyAmount | نعم | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
discount | MoneyAmount | نعم | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
total | MoneyAmount | نعم | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
created_at | string | نعم | — |
updated_at | string | لا | — |
الأخطاء التي يمكن أن تُرجعها نقطة النهاية هذه
401 · 403 · 422 · 429