agency-invoicing
POST /v1/agency-invoicing/invoices/{invoiceId}/issue
Give the invoice its number and freeze it.
Pengesahan
Hantar kunci API sebagai token pembawa. Kunci tersebut mesti membawa kebenaran agency.invoicing.manage; kunci yang tidak mempunyainya akan ditolak dengan 403, bukan 404.
Tempat ID organisasi anda diletakkan
Titik akhir ini mengambil org_id sebagai parameter pertanyaan. Biarkan ia kosong dan panggilan tersebut meliputi keseluruhan subpohon penyewaan anda; hantarkannya untuk mengecilkan panggilan kepada satu organisasi.
ID organisasi anda terletak pada skrin kekunci API dalam papan pemuka anda, di sebelah kekunci itu sendiri. Ia adalah ID yang sama dalam setiap panggilan yang anda buat.
Cuba
Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices/{invoiceId}/issue \
-H "Authorization: Bearer zdk_live_…"Sudah log masuk? Konsol API dalam papan pemuka anda mengisi id organisasi sebenar dan kunci anda sendiri, serta menjalankan permintaan terhadap API langsung supaya anda boleh melihat respons sebenar. Buka penamat ini dalam konsol API
Butiran
Allocates the next number in YOUR series, freezes both parties onto the document and makes the payment link live. ⛔ An invoice with no lines, or one totalling zero, is refused — a numbered document for nothing is a gap in a sequence a tax authority expects to be unbroken. Requires `agency.invoicing.manage`.
Parameter
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
invoiceId (path) | Uuid | Ya | — |
org_id (query) | Uuid | Tidak | 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… |
Respons
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
id | Uuid | Ya | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
number | string | Tidak | 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> | Ya | — |
is_overdue | boolean | Tidak | ⭐ 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 | Tidak | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
client_name | string | Tidak | — |
currency | string | Ya | — |
issue_date | string | Ya | — |
due_date | string | Tidak | — |
reference | string | Tidak | — |
notes | string | Tidak | — |
footer | string | Tidak | — |
subtotal_minor | integer | Tidak | — |
discount_minor | integer | Tidak | — |
tax_minor | integer | Tidak | — |
total_minor | integer | Ya | — |
amount_paid_minor | integer | Tidak | — |
amount_due_minor | integer | Tidak | — |
tax_breakdown | AgencyInvoiceTaxGroup[] | Tidak | — |
source | string | Tidak | Where the invoice came from — `time_tracking` when it was generated from tracked hours, empty when an agency typed it. |
sent_at | string | Tidak | — |
last_sent_to | string | Tidak | — |
paid_at | string | Tidak | — |
void_reason | string | Tidak | — |
created_at | string | Tidak | — |
lines | AgencyInvoiceLine[] | Tidak | — |
payments | AgencyInvoicePayment[] | Tidak | — |
portal_url | string | Tidak | 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,… |
Ralat yang boleh dikembalikan oleh titik akhir ini
401 · 403 · 404 · 409 · 429