Autentifikacija
Pošaljite API ključ kao nosivi token. Ključ mora imati dozvolu billing.view; ključ bez nje se odbija s kodom 403, a ne 404.
Gdje dolazi ID vaše organizacije
Ova krajnja točka uzima org_id kao parametar upita. Izostavite ga i poziv obuhvaćett cijelo stablo vašeg najma; pošaljite ga kako biste suzili poziv na jednu organizaciju.
ID vaše organizacije nalazi se na zaslonu API ključeva u vašoj nadzornoj ploči, pored samog ključa. To je isti ID u svakom pozivu koji uputite.
Isprobajte
Zamijenite sve unutar šiljastih zagrada svojim vlastitim vrijednostima, a rezervirano mjesto za ključ s ključem iz vaše nadzorne ploče.
curl -X GET https://api.zinndigital.com/v1/invoices \
-H "Authorization: Bearer zdk_live_…"Prijavljeni ste? API konzola na vašoj nadzornoj ploči automatski unosi stvarni ID vaše organizacije i vaš vlastiti ključ te šalje zahtjev prema aktivnom API-ju kako biste mogli vidjeti stvarni odgovor. Otvori ovu krajnju točku u API konzoli
Pojedinosti
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).
Parametri
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
X-Zinn-Org (header) | string | Ne | **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 | Ne | Opaque cursor from a previous page's `page.next_cursor`. |
limit (query) | integer | Ne | Maximum items to return (page size). |
status (query) | InvoiceStatus | Ne | Filter by billing-document status. |
org_id (query) | Uuid | Ne | Restrict to one organization in scope. |
Odgovor
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
data | Invoice[] | Da | — |
page | PageMeta | Da | — |
Pogreške koje ova krajnja točka može vratiti
401 · 403 · 422 · 429