agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/payments
Record money received — mark it paid or part-paid.
Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение agency.invoicing.manage; ключ без него отклоняется с кодом 403, а не 404.
Идентификатор вашей организации
Этот эндпоинт принимает org_id в качестве параметра запроса. Оставьте его пустым, и вызов охватит все поддерево вашей аренды; передайте его, чтобы сузить область вызова до одной организации.
Идентификатор вашей организации находится на экране ключей API в вашей панели управления, рядом с самим ключом. Это один и тот же идентификатор для каждого вашего запроса.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices/{invoiceId}/payments \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Defaults to the outstanding balance. The invoice's status is re-derived from the SUM of its payment rows, never incremented, so the two can never disagree. 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… |
Тело запроса
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
amount_minor | integer | Нет | Defaults to the outstanding balance. |
method | string<card, wallet, crypto, bank_transfer, cash, cheque, other> | Нет | — |
note | string | Нет | — |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
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 · 422 · 429