agency-invoicing
POST /v1/agency-invoicing/invoices
Start a draft invoice.
אימות
שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה agency.invoicing.manage; מפתח שאינו כולל אותה יידחה בסטטוס 403, ולא 404.
המקום שבו מזהה הארגון שלך נכנס
נקודת קצה זו מקבלת את org_id כפרמטר שאילתת חיפוש. השאר אותו ריק והקריאה תכסה את כל תת-עץ הדיירות שלך; שלח אותו כדי לצמצם את הקריאה לארגון אחד.
מזהה הארגון שלך נמצא במסוף מפתחות ה-API בלוח הבקרה שלך, לצד המפתח עצמו. זהו אותו מזהה בכל קריאה שאתה מבצע.
נסה זאת
החלף כל דבר בסוגריים זוויתיים בערכים משלך, ואת מציין מיקום המפתח במפתח מלוח הבקרה שלך.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'מחובר? קונסולת ה-API בלוח הבקרה שלך מזינה את מזהה הארגון האמיתי שלך ואת המפתח שלך, ומריצה את הבקשה מול ה-API הפיזי כך שתוכל לראות את התגובה בפועל. פתח נקודת קצה זו במסוף ה-API
פרטים
Give a `client_id`, or a `client` object to create one inline — a client typed during invoicing is SAVED, so next time you can just select them. ⛔ Totals are never accepted from the caller; they are computed from the lines. Requires `agency.invoicing.manage`.
פרמטרים
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
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… |
גוף הבקשה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
client_id | Uuid | לא | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
client | AgencyClientWrite | לא | — |
currency | string | לא | — |
issue_date | string | לא | — |
due_date | string | לא | — |
reference | string | לא | — |
notes | string | לא | — |
footer | string | לא | — |
lines | AgencyInvoiceLineWrite[] | לא | — |
תשובה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
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,… |
שגיאות שנקודה קצה זו עשויה להחזיר
401 · 403 · 404 · 422 · 429