billing

POST /v1/sla/claims

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

Wszystkie punkty końcowe billing

Wszystkie dokumentacje dla programistów

Uwierzytelnianie

Wyślij klucz API jako token bearer. Ten punkt końcowy nie określa konkretnego uprawnienia w specyfikacji, więc nadaj swojemu kluczowi minimum potrzebnych uprawnień i sprawdź odpowiedź zamiast zakładać.

Miejsce na identyfikator organizacji

Ten punkt końcowy przyjmuje org_id jako parametr zapytania. Pomiń go, a wywołanie obejmie całe drzewo dzierżawy; prześlij go, aby ograniczyć wywołanie do jednej organizacji.

Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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> }'

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

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.

Parametry

NazwaTypWymaganeCo to jest
org_id (query)stringNieNarrow 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…

Treść żądania

NazwaTypWymaganeCo to jest
monitor_idstringTak
period_startstringTakAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerNieThe 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…

Odpowiedź

NazwaTypWymaganeCo to jest
idstringTak
period_startstringTak
credit_percentintegerTak
amount_minorintegerTakThe credit in integer minor units of currency (§2.8 — money is never a float).
currencystringTak
outcomestring<measured, unadjudicable>TakWhether the month adjudicated, or the credit was granted because our coverage could not decide it.
uptime_percentstringTak
created_atstringTak

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 404 · 409 · 422