agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Tabbatar da Asali
Aiko da maɓallin API a matsayin bearer token. Wannan ma'anar ba ta bayyana takamaiman izini ba a cikin ƙayyadaddun bayanai, don haka ba wa maɓallin ku mafi ƙarancin abin da yake buƙata kuma ku bincika amsar maimakon yin zato.
Inda ID ɗin kungiyar ku ke zuwa
Wannan ma'ajiyar tana karɓar org_id a matsayin fili a cikin jikin JSON.
Ana samun lambar kungiyar ku a kan shafin maɓallan API a cikin madanninku, kusa da maɓallin kansa. Shi ne lambar da ta dace a kowane kiran da kuka yi.
Gwada
May gurbin komai da ke cikin kusurwa da ƙimar ka, kuma may gurbin maballi da maballi daga allon sarrafa ka.
curl -X POST https://api.zinndigital.com/v1/agency/time/schedules \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "trigger": <string<manual, on_log, day_of_month, threshold>> }'An shiga? Na'urar sarrafa API da ke cikin sashin kulawarka tana cika ainihin lambar ƙungiyarka da maɓallinka naka, sannan tana gudanar da buƙatar a kan ainihin API don haka zaka iya ganin amsar gaske. Buɗe wannan tashar a cikin na'urar kula da API
Bayani
Idempotent by `(org, client)` — a second POST updates rather than creating a second row, because two schedules for one client is the arrangement that bills them twice. Four triggers: `manual` (on demand only), `on_log` (immediately, as time is logged), `day_of_month`, and `threshold` (when unbilled work reaches an amount). ⛔ `day_of_month` is 1–28, and that is not a limitation of the storage. A schedule set to the 31st would silently skip February, April, June, September and November — seven months a year in which the agency is not paid and nothing is red. "The end of the month" is expressed as 28.
Jikin buƙata
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
client_id | string | A'a | — |
trigger | string<manual, on_log, day_of_month, threshold> | Eh | — |
day_of_month | integer | A'a | — |
threshold_minor | integer | A'a | — |
currency | string | A'a | — |
active | boolean | A'a | — |
org_id | string | A'a | — |
Martani
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
id | string | Eh | — |
client_id | string | A'a | `null` is the organisation-wide DEFAULT, covering every client without a row of its own. A per-client row replaces it rather than layering on it. |
trigger | string<manual, on_log, day_of_month, threshold> | Eh | — |
day_of_month | integer | A'a | ⛔ 1–28. The 29th to the 31st do not exist in every month, so a schedule set to the 31st would silently skip five of them a year. |
threshold_minor | integer | A'a | — |
currency | string | Eh | — |
active | boolean | Eh | — |
next_run_at | string | A'a | — |
last_attempted_at | string | A'a | Stamped for every schedule the sweep REACHES, before its result is read — so a client whose invoice fails still leaves the front of the queue. |
last_succeeded_at | string | A'a | A SECOND column, deliberately: one column cannot serve as both the cursor the sweep advances and the signal a staleness alarm reads. |
last_error | string | A'a | — |
Kuskuren da wannan matsaya za ta iya maido wa
401 · 403 · 422