agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Autentifikimi
Drgoni një çelës API si një token mbajtës. Ky pikëndalim nuk specifikon një leje specifike në specifikim, prandaj jepini çelësit tuaj minimumin e nevojshëm dhe kontrolloni përgjigjen në vend që të supozoni.
Ku shkon id i organizatës suaj
Ky endpoint pranon org_id si fushë në trupin JSON.
ID-ja e organizatës suaj ndodhet në ekranin e çelësave API në panelin tuaj të kontrollit, pranë vetë çelësit. Është i njëjti ID në çdo thirrje që bëni.
Provoje
Zëvendësoni çdo gjë brenda kllapave këndore me vlerat tuaja dhe vendbanuesin e çelësit me një çelës nga paneli juaj.
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>> }'Jeni kyçur? Konsola e API-së në panelin tuaj plotëson ID-në tuaj reale të organizatës dhe çelësin tuaj, dhe ekzekuton kërkesën kundrejt API-së live, kështu që ju mund të shihni përgjigjen aktuale. Hapni këtë pikë fundore në konsolën e API-së
Detajet
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.
Trupi i kërkesës
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
client_id | string | Jo | — |
trigger | string<manual, on_log, day_of_month, threshold> | Po | — |
day_of_month | integer | Jo | — |
threshold_minor | integer | Jo | — |
currency | string | Jo | — |
active | boolean | Jo | — |
org_id | string | Jo | — |
Përgjigja
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
id | string | Po | — |
client_id | string | Jo | `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> | Po | — |
day_of_month | integer | Jo | ⛔ 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 | Jo | — |
currency | string | Po | — |
active | boolean | Po | — |
next_run_at | string | Jo | — |
last_attempted_at | string | Jo | 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 | Jo | 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 | Jo | — |
Gabimet që ky pikëndalim mund të kthejë
401 · 403 · 422