agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/send
Email the invoice to your client, with the PDF attached.
Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền agency.invoicing.manage; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Nơi điền id tổ chức của bạn
Điểm cuối này nhận org_id làm tham số truy vấn. Hãy bỏ trống để áp dụng cho toàn bộ cây thuê của bạn; hoặc truyền giá trị vào để thu hẹp phạm vi gọi về một tổ chức duy nhất.
Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices/{invoiceId}/send \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
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`.
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
invoiceId (path) | Uuid | Có | — |
org_id (query) | Uuid | Không | 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… |
Nội dung yêu cầu
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
to | string | Không | Where to send it. Defaults to the client's stored email. |
locale | string | Không | 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 | Không | A covering line to put above the amount. |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
number | string | Không | 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> | Có | — |
is_overdue | boolean | Không | ⭐ 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 | Không | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
client_name | string | Không | — |
currency | string | Có | — |
issue_date | string | Có | — |
due_date | string | Không | — |
reference | string | Không | — |
notes | string | Không | — |
footer | string | Không | — |
subtotal_minor | integer | Không | — |
discount_minor | integer | Không | — |
tax_minor | integer | Không | — |
total_minor | integer | Có | — |
amount_paid_minor | integer | Không | — |
amount_due_minor | integer | Không | — |
tax_breakdown | AgencyInvoiceTaxGroup[] | Không | — |
source | string | Không | Where the invoice came from — `time_tracking` when it was generated from tracked hours, empty when an agency typed it. |
sent_at | string | Không | — |
last_sent_to | string | Không | — |
paid_at | string | Không | — |
void_reason | string | Không | — |
created_at | string | Không | — |
lines | AgencyInvoiceLine[] | Không | — |
payments | AgencyInvoicePayment[] | Không | — |
portal_url | string | Không | 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 | Không | — |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 409 · 422 · 429 · 503