agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Pagpapatotoo
Magpadala ng API key bilang bearer token. Ang endpoint na ito ay hindi naglatag ng tiyak na pahintulot sa pagtutukoy, kaya ibigay sa iyong key ang pinakamababang kailangan nito at suriin ang tugon sa halip na umasa.
Kung saan mapupunta ang id ng iyong organisasyon
Ang endpoint na ito ay kumukuha ng org_id bilang isang field sa JSON body.
Ang id ng iyong organisasyon ay nasa screen ng mga API key sa iyong dashboard, sa tabi mismo ng key. Ito ang parehong id sa bawat tawag na gagawin mo.
Subukan ito
Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.
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>> }'Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API
Mga Detalye
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.
Katawan ng kahilingan
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
client_id | string | Hindi | — |
trigger | string<manual, on_log, day_of_month, threshold> | Oo | — |
day_of_month | integer | Hindi | — |
threshold_minor | integer | Hindi | — |
currency | string | Hindi | — |
active | boolean | Hindi | — |
org_id | string | Hindi | — |
Tugon
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
id | string | Oo | — |
client_id | string | Hindi | `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> | Oo | — |
day_of_month | integer | Hindi | ⛔ 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 | Hindi | — |
currency | string | Oo | — |
active | boolean | Oo | — |
next_run_at | string | Hindi | — |
last_attempted_at | string | Hindi | 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 | Hindi | 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 | Hindi | — |
Mga error na maibabalik ng endpoint na ito
401 · 403 · 422