agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Autentikasi
Kirimkan kunci API sebagai token bearer. Titik akhir ini tidak menyatakan izin tertentu dalam spesifikasi, jadi berikan kunci Anda izin minimum yang diperlukan dan periksa responsnya alih-alih berasumsi.
Tempat ID organisasi Anda dimasukkan
Titik akhir ini memerlukan org_id sebagai field dalam bodi JSON.
ID organisasi Anda berada di layar kunci API di dasbor Anda, di sebelah kunci itu sendiri. Itu adalah ID yang sama dalam setiap panggilan yang Anda buat.
Coba
Ganti apa pun di dalam tanda kurung sudut dengan nilai Anda sendiri, dan placeholder kunci dengan kunci dari dasbor Anda.
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>> }'Sudah masuk? Konsol API di dasbor Anda akan mengisi ID organisasi asli dan kunci Anda sendiri, serta menjalankan permintaan terhadap API langsung sehingga Anda dapat melihat respons aktualnya. Buka titik akhir ini di konsol API
Detail
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.
Isi permintaan
| Nama | Jenis | Wajib | Tentang apa ini |
|---|---|---|---|
client_id | string | Tidak | — |
trigger | string<manual, on_log, day_of_month, threshold> | Ya | — |
day_of_month | integer | Tidak | — |
threshold_minor | integer | Tidak | — |
currency | string | Tidak | — |
active | boolean | Tidak | — |
org_id | string | Tidak | — |
Tanggapan
| Nama | Jenis | Wajib | Tentang apa ini |
|---|---|---|---|
id | string | Ya | — |
client_id | string | Tidak | `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> | Ya | — |
day_of_month | integer | Tidak | ⛔ 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 | Tidak | — |
currency | string | Ya | — |
active | boolean | Ya | — |
next_run_at | string | Tidak | — |
last_attempted_at | string | Tidak | 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 | Tidak | 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 | Tidak | — |
Kesalahan yang dapat dikembalikan oleh titik akhir ini
401 · 403 · 422