Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền billing.view; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Nơi điền id tổ chức của bạn
Điểm cuối này nhận org_id làm tham số truy vấn. Hãy bỏ trống để áp dụng cho toàn bộ cây thuê của bạn; hoặc truyền giá trị vào để thu hẹp phạm vi gọi về một tổ chức duy nhất.
Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X GET https://api.zinndigital.com/v1/invoices \
-H "Authorization: Bearer zdk_live_…"Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
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).
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
X-Zinn-Org (header) | string | Không | **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 | Không | Opaque cursor from a previous page's `page.next_cursor`. |
limit (query) | integer | Không | Maximum items to return (page size). |
status (query) | InvoiceStatus | Không | Filter by billing-document status. |
org_id (query) | Uuid | Không | Restrict to one organization in scope. |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
data | Invoice[] | Có | — |
page | PageMeta | Có | — |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 422 · 429