agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/send
Email the invoice to your client, with the PDF attached.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز agency.invoicing.manage باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد میشود، نه 404.
جایی که شناسه سازمان شما قرار میگیرد
این نقطه پایانی 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`.
پارامترها
| نام | نوع | الزامی | چیست |
|---|---|---|---|
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 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