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, за да можете да видите действителния отговор. Отворете този крайpoint в 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Да

Грешки, които този крайpoint може да върне

401 · 403 · 404 · 409 · 422