agency-time
POST /v1/agency/time/schedules
Set a client's billing trigger.
Autentifikatsiya
API kalitini bearer token sifatida yuboring. Ushbu yakuniy nuqta spetsifikatsiyada ma'lum bir ruxsatni ko'rsatmaydi, shuning uchun kalitingizga eng kam kerakli huquqni bering va taxmin qilish o'rniga javobni tekshiring.
Tashkilotingiz identifikatori kiritiladigan joy
Ushbu so'rov JSON tanasida org_id ni maydon sifatida qabul qiladi.
Tashkilotingiz identifikatori boshqaruv panelingizdagi API kalitlari ekranida, kalitning o'z yonida joylashgan. Bu siz amalga oshiradigan har bir so'rovda bir xil identifikator hisoblanadi.
Sinab ko'rish
Qavslardagi har qanday narsani o'z qiymatlaringiz bilan, kalit pleysxolderini эsa boshqaruv panelingizdagi kalit bilan almashtiring.
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>> }'Tizimga kirganmisiz? Boshqaruv panelingizdagi API konsoli haqiqiy tashkilot ID raqamingiz va shaxsiy kalitingizni avtomatik to'ldiradi hamda haqiqiy javobni ko'rishingiz uchun so'rovni jonli API orqali bajaradi. Ushbu yakuniy nuqtani API konsolida oching
Tafsilotlar
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.
Soʻrov tanasi
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
client_id | string | Yo'q | — |
trigger | string<manual, on_log, day_of_month, threshold> | Ha | — |
day_of_month | integer | Yo'q | — |
threshold_minor | integer | Yo'q | — |
currency | string | Yo'q | — |
active | boolean | Yo'q | — |
org_id | string | Yo'q | — |
Javob
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
id | string | Ha | — |
client_id | string | Yo'q | `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> | Ha | — |
day_of_month | integer | Yo'q | ⛔ 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 | Yo'q | — |
currency | string | Ha | — |
active | boolean | Ha | — |
next_run_at | string | Yo'q | — |
last_attempted_at | string | Yo'q | 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 | Yo'q | 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 | Yo'q | — |
Ushbu yakuniy nuqta qaytarishi mumkin bo'lgan xatolar
401 · 403 · 422