agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/issue
Give the invoice its number and freeze it.
Автентифікація
Надішліть ключ API як маркер носія (bearer token). Ключ повинен мати дозвіл agency.invoicing.manage; ключ без нього відхиляється з кодом 403, а не 404.
Де вказується ідентифікатор вашої організації
Цей ендпоїнт приймає org_id як параметр запиту. Залиште його порожнім, і виклик охопить увесь ваше дерево орендарів; надішліть його, щоб звузити виклик до однієї організації.
Ідентифікатор вашої організації знаходиться на екрані API-ключів у вашій панелі керування, поруч із самим ключем. Це той самий ідентифікатор у кожному вашому запиті.
Спробувати
Замініть усе в кутових дужках власними значеннями, а заповнювач ключа — ключем із вашої панелі керування.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices/{invoiceId}/issue \
-H "Authorization: Bearer zdk_live_…"Увійшли в систему? Консоль API у вашій панелі керування автоматично підставляє ваш реальний ідентифікатор організації та ваш власний ключ, а також виконує запит до робочого API, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі API
Деталі
Allocates the next number in YOUR series, freezes both parties onto the document and makes the payment link live. ⛔ An invoice with no lines, or one totalling zero, is refused — a numbered document for nothing is a gap in a sequence a tax authority expects to be unbroken. Requires `agency.invoicing.manage`.
Параметри
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
invoiceId (path) | Uuid | Так | — |
org_id (query) | Uuid | Ні | Which of your organizations is invoicing. Required only when you belong to more than one — otherwise it is inferred from your DIRECT membership, never from the subtree-expanded… |
Відповідь
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
id | Uuid | Так | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
number | string | Ні | The agency's own number. ⛔ Empty until issue: a number allocated to something that may never be sent leaves a hole in a sequence. |
status | string<draft, sent, partially_paid, paid, void> | Так | — |
is_overdue | boolean | Ні | ⭐ DERIVED from the due date and the status, never stored — so there is no sweep to maintain a flag and nothing to go stale. A draft is never overdue however old it is: nobody ha… |
client_id | Uuid | Ні | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
client_name | string | Ні | — |
currency | string | Так | — |
issue_date | string | Так | — |
due_date | string | Ні | — |
reference | string | Ні | — |
notes | string | Ні | — |
footer | string | Ні | — |
subtotal_minor | integer | Ні | — |
discount_minor | integer | Ні | — |
tax_minor | integer | Ні | — |
total_minor | integer | Так | — |
amount_paid_minor | integer | Ні | — |
amount_due_minor | integer | Ні | — |
tax_breakdown | AgencyInvoiceTaxGroup[] | Ні | — |
source | string | Ні | Where the invoice came from — `time_tracking` when it was generated from tracked hours, empty when an agency typed it. |
sent_at | string | Ні | — |
last_sent_to | string | Ні | — |
paid_at | string | Ні | — |
void_reason | string | Ні | — |
created_at | string | Ні | — |
lines | AgencyInvoiceLine[] | Ні | — |
payments | AgencyInvoicePayment[] | Ні | — |
portal_url | string | Ні | The payment link to send to the client. ⛔ Returned on a SINGLE-invoice read only, never in a list: a list is the thing that gets logged, cached and pasted into a support ticket,… |
Помилки, які може повертати ця кінцева точка
401 · 403 · 404 · 409 · 429