billing

POST /v1/sla/claims

Claim the service credit for one monitored site's month.

Усі кінцеві точки billing

Автентифікація

Надішліть ключ 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_idstringТак
period_startstringТакAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerНі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…

Відповідь

НазваТипОбов'язковеЩо це таке
idstringТак
period_startstringТак
credit_percentintegerТак
amount_minorintegerТакThe credit in integer minor units of `currency` (§2.8 — money is never a float).
currencystringТак
outcomestring<measured, unadjudicable>ТакWhether the month adjudicated, or the credit was granted because our coverage could not decide it.
uptime_percentstringТак
created_atstringТак

Помилки, які може повертати ця кінцева точка

401 · 403 · 404 · 409 · 422