billing

POST /v1/sla/claims

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

Све billing крајње тачке

Сва документација за програмере →

Аутентификација

Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.

Где се уноси ID ваше организације

Ова крајња тачка прихвата 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 конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом 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