billing
GET /v1/invoices
List the organization's billing documents.
المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (API key) كرمز حامل (bearer token). يجب أن يحمل المفتاح إذن billing.view؛ والمفتاح الذي لا يملكه يُرفض بالرمز 403 وليس 404.
حيث يتم إدخال معرف مؤسستك
تأخذ نقطة النهاية هذه org_id كمعلمة استعلام. اتركه فارغاً ليغطي الاستدعاء شجرة مستأجريك بالكامل، أو أرسله لتضييق نطاق الاستدعاء ليشمل منظمة واحدة.
معرف مؤسستك موجود على شاشة مفاتيح واجهة برمجة التطبيقات (API) في لوحة تحكمك، بجوار المفتاح نفسه. وهو نفس المعرف في كل طلب تجريه.
جربه الآن
استبدل أي شيء بين أقواس زاوية بقيمك الخاصة، والعنصر النائب للمفتاح بمفتاح من لوحة تحكمك.
curl -X GET https://api.zinndigital.com/v1/invoices \
-H "Authorization: Bearer zdk_live_…"هل سجلت الدخول؟ تقوم وحدة تحكم واجهة برمجة التطبيقات في لوحة التحكم الخاصة بك بربط معرف مؤسستك الحقيقي ومفتاحك الخاص، وتنفذ الطلب مقابل واجهة برمجة التطبيقات المباشرة لتتمكن من رؤية الاستجابة الفعلية. افتح هذه النهاية الطرفية في وحدة تحكم API
التفاصيل
The organization's billing history — every invoice and credit note issued to it, newest first, with its lines, its payment summaries and the captured amounts. Cursor-paginated, filterable by status; RLS-scoped; requires billing.view. These are the real legal documents (docs/34 §1). Each is an immutable snapshot with a gapless, per-entity ZD-INV-YYYY-NNNNNN number, a captured tax treatment and its own frozen FX rates. document_type separates an invoice from a credit note; credits_invoice_id says which invoice a credit note un-bills. ⚠️ The document is issued by a sweep, a couple of minutes after payment, not synchronously at checkout (docs/34 §4.1). Render a pending state for a just-placed order rather than assuming the document is there the moment checkout returns. pdf_url stays null until PDF rendering lands (#708).
المعلمات
| الاسم | النوع | مطلوب | ما هو هذا |
|---|---|---|---|
X-Zinn-Org (header) | string | لا | Which organisation this call acts for. Send a client organisation's id and every org-scoped endpoint answers for that client alone; omit it and the answer covers everything… |
cursor (query) | string | لا | Opaque cursor from a previous page's page.next_cursor. |
limit (query) | integer | لا | Maximum items to return (page size). |
status (query) | InvoiceStatus | لا | Filter by billing-document status. |
org_id (query) | Uuid | لا | Restrict to one organization in scope. |
الاستجابة
| الاسم | النوع | مطلوب | ما هو هذا |
|---|---|---|---|
data | Invoice[] | نعم | — |
page | PageMeta | نعم | — |
الأخطاء التي يمكن أن تُرجعها نقطة النهاية هذه
401 · 403 · 422 · 429