Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение billing.view; ключ без него отклоняется с кодом 403, а не 404.
Идентификатор вашей организации
Этот эндпоинт принимает org_id в качестве параметра запроса. Оставьте его пустым, и вызов охватит все поддерево вашей аренды; передайте его, чтобы сузить область вызова до одной организации.
Идентификатор вашей организации находится на экране ключей API в вашей панели управления, рядом с самим ключом. Это один и тот же идентификатор для каждого вашего запроса.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X GET https://api.zinndigital.com/v1/invoices \
-H "Authorization: Bearer zdk_live_…"Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в 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