billing

POST /v1/sla/claims

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

Alle billing Endpunkte

Authentifizierung

Senden Sie einen API-Schlüssel als Bearer-Token. Dieser Endpunkt gibt in der Spezifikation keine spezifische Berechtigung an. Versehen Sie Ihren Schlüssel daher mit den minimal erforderlichen Rechten und prüfen Sie die Antwort, anstatt Annahmen zu treffen.

Hier kommt Ihre Organisations-ID hin

Dieser Endpunkt akzeptiert org_id als Abfrageparameter. Lassen Sie ihn weg, erfasst der Aufruf Ihren gesamten Mandanten-Unterbaum; übergeben Sie ihn, um den Aufruf auf eine Organisation einzugrenzen.

Die ID Ihrer Organisation finden Sie im Dashboard auf dem Bildschirm für API-Schlüssel direkt neben dem Schlüssel selbst. Sie ist bei jedem Ihrer Aufrufe dieselbe.

Ausprobieren

Ersetzen Sie alles in spitzen Klammern durch Ihre eigenen Werte und den Platzhalter für den Schlüssel durch einen Schlüssel aus Ihrem Dashboard.

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

Angemeldet? Die API-Konsole in Ihrem Dashboard trägt automatisch Ihre echte Organisations-ID sowie Ihren eigenen Schlüssel ein und führt die Anfrage gegen die Live-API aus, sodass Sie die tatsächliche Antwort sehen können. Öffnen Sie diesen Endpunkt in der API-Konsole

Details

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`.

Parameter

NameTypErforderlichWas es ist
org_id (query)stringNeinNarrow 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…

Anfragekörper

NameTypErforderlichWas es ist
monitor_idstringJa
period_startstringJaAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerNeinThe 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…

Antwort

NameTypErforderlichWas es ist
idstringJa
period_startstringJa
credit_percentintegerJa
amount_minorintegerJaThe credit in integer minor units of `currency` (§2.8 — money is never a float).
currencystringJa
outcomestring<measured, unadjudicable>JaWhether the month adjudicated, or the credit was granted because our coverage could not decide it.
uptime_percentstringJa
created_atstringJa

Fehler, die dieser Endpunkt zurückgeben kann

401 · 403 · 404 · 409 · 422