agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/send
Email the invoice to your client, with the PDF attached.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу agency.invoicing.manage; кључ без ње се одбија уз 403, а не 404.
Где се уноси ID ваше организације
Ова крајња тачка прихвата org_id као параметар упита. Изоставите га и позив ће обухватити цело подстабло вашег закупа; пошаљите га да бисте сузили позив на једну организацију.
Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices/{invoiceId}/send \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Issues it first if it is still a draft. Leaves on YOUR mail account when you have connected one, otherwise on ours with your address as Reply-To and a line saying who issued it. The PDF is attached as bytes rather than linked — a link would expire, and it would put our storage hostname in front of your client. 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… |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
to | string | Не | Where to send it. Defaults to the client's stored email. |
locale | string | Не | Which language to render in. Defaults to the client's locale — an agency in Berlin invoicing a French client sends a French invoice. |
note | string | Не | A covering line to put above the amount. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
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 has… |
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,… |
sent_to | string | Не | — |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 409 · 422 · 429 · 503