agency-time

POST /v1/agency/time/schedules

Set a client's billing trigger.

Vituo vyote vya agency-time

Uthibitishaji

Tuma ufunguo wa API kama tokeni ya kubeba. Sehemu hii ya mwisho haitaji ruhusa maalum katika maelezo, kwa hivyo ipe ufunguo wako kiwango cha chini kabisa kinachohitajika na uangalie jibu badala ya kukisia.

Mahali ambapo kitambulisho cha shirika lako huwekwa

Sehemu hii ya mwisho inachukua org_id kama uwanja katika mwili wa JSON.

Kitambulisho cha shirika lako kipo kwenye skrini ya funguo za API katika dashibodi yako, kando ya ufunguo wenyewe. Ni kitambulisho kile kile katika kila ombi unalofanya.

Jaribu

Badilisha chochote kilicho ndani ya mabano ya pembe na maadili yako mwenyewe, na kishikiliaji cha ufunguo na ufunguo kutoka kwa dashibodi yako.

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>> }'

Umeingia kwenye akaunti? Dashibodi yako ya kiweko cha API inajaza kitambulisho chako halisi cha shirika na ufunguo wako mwenyewe, na kuendesha ombi dhidi ya API ya moja kwa moja ili uweze kuona jibu halisi. Fungua sehemu hii ya mwisho (endpoint) kwenye konsole ya API

Maelezo

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.

Mwili wa ombi

JinaAinaInayohitajikaKilicho hiki
client_idstringHapana
triggerstring<manual, on_log, day_of_month, threshold>Ndiyo
day_of_monthintegerHapana
threshold_minorintegerHapana
currencystringHapana
activebooleanHapana
org_idstringHapana

Majibu

JinaAinaInayohitajikaKilicho hiki
idstringNdiyo
client_idstringHapana`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.
triggerstring<manual, on_log, day_of_month, threshold>Ndiyo
day_of_monthintegerHapana⛔ 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_minorintegerHapana
currencystringNdiyo
activebooleanNdiyo
next_run_atstringHapana
last_attempted_atstringHapanaStamped 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_atstringHapanaA SECOND column, deliberately: one column cannot serve as both the cursor the sweep advances and the signal a staleness alarm reads.
last_errorstringHapana

Hitilafu ambazo mwisho huu unaweza kurudisha

401 · 403 · 422