agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Autentificare
Trimiteți o cheie API ca token de tip bearer. Acest punct final nu specifică o permisiune anume în specificație, așa că acordați cheii cele mai puține drepturi necesare și verificați răspunsul în loc să faceți presupuneri.
Unde merge ID-ul organizației tale
Acest punct final preia org_id ca câmp în corpul JSON.
ID-ul organizației tale se află pe ecranul cheilor API din panoul de control, lângă cheia însăși. Este același ID în fiecare apel pe care îl faci.
Încearcă
Înlocuiți tot ce se află între paranteze unghiulare cu propriile valori și substituentul cheie cu o cheie din tabloul de bord.
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>> }'Autentificat? Consola API din panoul de control îți completează ID-ul real al organizației și propria cheie și rulează cererea în API-ul live, astfel încât să poți vedea răspunsul efectiv. Deschideți acest punct final în consola API
Detalii
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.
Corp cerere
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
client_id | string | Nu | — |
trigger | string<manual, on_log, day_of_month, threshold> | Da | — |
day_of_month | integer | Nu | — |
threshold_minor | integer | Nu | — |
currency | string | Nu | — |
active | boolean | Nu | — |
org_id | string | Nu | — |
Răspuns
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
id | string | Da | — |
client_id | string | Nu | `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> | Da | — |
day_of_month | integer | Nu | ⛔ 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 | Nu | — |
currency | string | Da | — |
active | boolean | Da | — |
next_run_at | string | Nu | — |
last_attempted_at | string | Nu | 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 | Nu | 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 | Nu | — |
Erori pe care le poate returna acest punct final
401 · 403 · 422