agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Kimlik Doğrulama
Bir API anahtarını bearer token olarak gönderin. Bu uç nokta, teknik özelliklerde belirli bir yetki belirtmemektedir; bu nedenle, varsaymak yerine anahtarınıza ihtiyaç duyduğu en az yetkiyi verin ve yanıtı kontrol edin.
Kurum kimliğinizin yazılacağı yer
Bu uç nokta, JSON gövdesinde bir alan olarak org_id alır.
Kuruluş kimliğiniz (id), kontrol panelinizdeki API anahtarları ekranında, anahtarın hemen yanında yer alır. Yaptığınız her çağrıda aynı kimlik kullanılır.
Dene
Köşeli parantez içindeki her şeyi kendi değerlerinizle ve anahtar yer tutucusunu panonuzdan bir anahtarla değiştirin.
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>> }'Oturum açtınız mı? Panonuzdaki API konsolu, gerçek organizasyon kimliğinizi ve kendi anahtarınızı otomatik olarak doldurur ve isteği canlı API üzerinde çalıştırarak gerçek yanıtı görmenizi sağlar. Bu uç noktayı API konsolunda açın
Ayrıntılar
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.
İstek gövdesi
| Ad | Tür | Zorunlu | Ne olduğu |
|---|---|---|---|
client_id | string | Hayır | — |
trigger | string<manual, on_log, day_of_month, threshold> | Evet | — |
day_of_month | integer | Hayır | — |
threshold_minor | integer | Hayır | — |
currency | string | Hayır | — |
active | boolean | Hayır | — |
org_id | string | Hayır | — |
Yanıt
| Ad | Tür | Zorunlu | Ne olduğu |
|---|---|---|---|
id | string | Evet | — |
client_id | string | Hayır | `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> | Evet | — |
day_of_month | integer | Hayır | ⛔ 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 | Hayır | — |
currency | string | Evet | — |
active | boolean | Evet | — |
next_run_at | string | Hayır | — |
last_attempted_at | string | Hayır | 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 | Hayır | 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 | Hayır | — |
Bu uç noktanın dönderebileceği hatalar
401 · 403 · 422