agency-invoicing

POST /v1/agency-invoicing/invoices/{invoiceId}/send

Email the invoice to your client, with the PDF attached.

Все эндпоинты agency-invoicing

Аутентификация

Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение 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…

Тело запроса

ИмяТипОбязательноЧто это
tostringНетWhere to send it. Defaults to the client's stored email.
localestringНетWhich language to render in. Defaults to the client's locale — an agency in Berlin invoicing a French client sends a French invoice.
notestringНетA covering line to put above the amount.

Ответ

ИмяТипОбязательноЧто это
idUuidДаUUIDv7 identifier — sortable by creation time (docs/02 §8).
numberstringНетThe agency's own number. ⛔ Empty until issue: a number allocated to something that may never be sent leaves a hole in a sequence.
statusstring<draft, sent, partially_paid, paid, void>Да
is_overduebooleanНет⭐ 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_idUuidНетUUIDv7 identifier — sortable by creation time (docs/02 §8).
client_namestringНет
currencystringДа
issue_datestringДа
due_datestringНет
referencestringНет
notesstringНет
footerstringНет
subtotal_minorintegerНет
discount_minorintegerНет
tax_minorintegerНет
total_minorintegerДа
amount_paid_minorintegerНет
amount_due_minorintegerНет
tax_breakdownAgencyInvoiceTaxGroup[]Нет
sourcestringНетWhere the invoice came from — `time_tracking` when it was generated from tracked hours, empty when an agency typed it.
sent_atstringНет
last_sent_tostringНет
paid_atstringНет
void_reasonstringНет
created_atstringНет
linesAgencyInvoiceLine[]Нет
paymentsAgencyInvoicePayment[]Нет
portal_urlstringНет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_tostringНет

Ошибки, которые может возвращать этот эндпоинт

401 · 403 · 404 · 409 · 422 · 429 · 503