agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/send
Email the invoice to your client, with the PDF attached.
Аутентификация
API кілтін bearer токені ретінде жіберіңіз. Кілтте agency.invoicing.manage рұқсаты болуы тиіс; онсыз кілтке 404 емес, 403 қатесі қайтарылады.
Ұйымыңыздың идентификаторы орналасатын жер
Бұл соңғы нүкте сұрау параметрі ретінде 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 консолі ұйымыңыздың нақты идентификаторы мен жеке кілтіңізді автоматты түрде толтырады да, нақты жауапты көре алуыңыз үшін сұрауды тікелей жұмыс істеп тұрған 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`.
Параметрлер
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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… |
Сұрау денесі
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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. |
Жауап
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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,… |
sent_to | string | Жоқ | — |
Бұл соңғы нүкте қайтара алатын қателер
401 · 403 · 404 · 409 · 422 · 429 · 503