agency-invoicing
POST /v1/agency-invoicing/invoices
Start a draft invoice.
Аутентификация
API кілтін bearer токені ретінде жіберіңіз. Кілтте agency.invoicing.manage рұқсаты болуы тиіс; онсыз кілтке 404 емес, 403 қатесі қайтарылады.
Ұйымыңыздың идентификаторы орналасатын жер
Бұл соңғы нүкте сұрау параметрі ретінде 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`.
Параметрлер
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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… |
Сұрау денесі
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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[] | Жоқ | — |
Жауап
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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