billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
Автентифікація
Надішліть ключ API як маркер носія (bearer token). Ця кінцева точка не вказує конкретного дозволу в специфікації, тому надайте своєму ключу мінімально необхідні права та перевірте відповідь, замість того щоб припускати.
Де вказується ідентифікатор вашої організації
Цей ендпоїнт приймає org_id як параметр запиту. Залиште його порожнім, і виклик охопить увесь ваше дерево орендарів; надішліть його, щоб звузити виклик до однієї організації.
Ідентифікатор вашої організації знаходиться на екрані API-ключів у вашій панелі керування, поруч із самим ключем. Це той самий ідентифікатор у кожному вашому запиті.
Спробувати
Замініть усе в кутових дужках власними значеннями, а заповнювач ключа — ключем із вашої панелі керування.
curl -X POST https://api.zinndigital.com/v1/sla/claims \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "monitor_id": <string>, "period_start": <string> }'Увійшли в систему? Консоль API у вашій панелі керування автоматично підставляє ваш реальний ідентифікатор організації та ваш власний ключ, а також виконує запит до робочого API, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі API
Деталі
Issues account credit — not cash — as a share of that site's monthly fee, and records it. **Idempotent by construction:** one month and one monitor may be credited exactly once, enforced by a unique constraint, so a retry, a race and a double click all lose the same way. `credit_percent` is read **only** when the month is `unadjudicable`; a measured month is credited at the tier its own figure reaches and a better one cannot be claimed. Gated on `sla.claim`.
Параметри
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
org_id (query) | string | Ні | Narrow to one organisation in the caller's subtree — what the dashboard's org switcher sends. ⛔ **Narrow only:** intersected with what the caller may already write to, so an org… |
Тіло запиту
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
monitor_id | string | Так | — |
period_start | string | Так | Any instant in the calendar month being claimed; the month is derived from it. |
credit_percent | integer | Ні | The published tier claimed. Read **only** when the month is `unadjudicable`, and refused unless it is one of `SlaPolicy.tiers[].credit_percent` — a tier is never rounded to the… |
Відповідь
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
id | string | Так | — |
period_start | string | Так | — |
credit_percent | integer | Так | — |
amount_minor | integer | Так | The credit in integer minor units of `currency` (§2.8 — money is never a float). |
currency | string | Так | — |
outcome | string<measured, unadjudicable> | Так | Whether the month adjudicated, or the credit was granted because our coverage could not decide it. |
uptime_percent | string | Так | — |
created_at | string | Так | — |
Помилки, які може повертати ця кінцева точка
401 · 403 · 404 · 409 · 422