agency-invoicing
POST /v1/agency-invoicing/invoices
Start a draft invoice.
Баталгаажуулалт
API түлхүүрийг bearer token хэлбэрээр илгөэнэ үү. Түлхүүр нь agency.invoicing.manage эрхтэй байх ёстой бөгөөд үүнгүйгээр 404 биш, харин 403 алдаа буцааж татгалзах болно.
Таны байгууллагын дугаар орох газар
Энэ төгсгөл цэг нь org_id-г асуулгын параметр болгон авдаг. Үүнийг орхивол дуудлага таны бүх түрээсийн дэд модыг хамрах бөгөөд дуудлагыг зөвхөн нэг байгууллагаар хязгаарлахын тулд үүнийг илгээнэ үү.
Танай байгууллагын ID нь таны хяналтын самбар дээрх API түлхүүрийн дэлгэцэнд, түлхүүр өөрөө хажууд байрладаг. Энэ нь таны хийх дуудлага бүрт ижил ID байна.
Туршиж үзэх
Өнцөг хаалтанд байгаа бүх зүйлийг өөрийн утгаар солиж, түлхүүр санамж байрлуулагчийг хяналтын самбарынхаа түлхүүрээр сольж оруулна уу.
curl -X POST https://api.zinndigital.com/v1/agency-invoicing/invoices \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Та нэвтэрсэн байна уу? Таны хяналтын самбар дахь API консол нь таны бодит байгууллагын ID болон өөрийн түлхүүрийг автоматаар бөглөж, шууд ажиллаж буй 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