agency-time

POST /v1/agency/time/schedules

Set a client's billing trigger.

Sve agency-time krajnje tačke

Autentifikacija

Pošaljite API ključ kao bearer token. Ova krajnja tačka ne navodi specifičnu dozvolu u specifikaciji, zato dodelite svom ključu minimum potrebnih ovlašćenja i proverite odgovor umesto da pretpostavljate.

Gde ide ID vaše organizacije

Ova krajnja tačka prihvata org_id kao polje u JSON telu.

ID vaše organizacije nalazi se na ekranu sa API ključevima u vašoj kontrolnoj tabli, pored samog ključa. To je isti ID u svakom pozivu koji uputite.

Isprobajte

Zamenite bilo šta u uglastim zagradama sopstvenim vrednostima, a ključni placeholder sa ključem sa vaše kontrolne table.

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

Prijavljeni ste? API konzola na vašoj kontrolnoj tabli automatski popunjava ID vaše stvarne organizacije i vaš sopstveni ključ, i izvršava zahtev nad API-jem uživo tako da možete videti stvarni odgovor. Otvorite ovu krajnju tačku u API konzoli

Detalji

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.

Telo zahteva

NazivVrstaObaveznoŠta je ovo
client_idstringNe
triggerstring<manual, on_log, day_of_month, threshold>Da
day_of_monthintegerNe
threshold_minorintegerNe
currencystringNe
activebooleanNe
org_idstringNe

Odgovor

NazivVrstaObaveznoŠta je ovo
idstringDa
client_idstringNe`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>Da
day_of_monthintegerNe⛔ 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_minorintegerNe
currencystringDa
activebooleanDa
next_run_atstringNe
last_attempted_atstringNeStamped 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_atstringNeA SECOND column, deliberately: one column cannot serve as both the cursor the sweep advances and the signal a staleness alarm reads.
last_errorstringNe

Greške koje ovaj krajnji tačka može da vrati

401 · 403 · 422