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