billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
Autentificare
Trimiteți o cheie API ca token de tip bearer. Acest punct final nu specifică o permisiune anume în specificație, așa că acordați cheii cele mai puține drepturi necesare și verificați răspunsul în loc să faceți presupuneri.
Unde merge ID-ul organizației tale
Acest punct final acceptă org_id ca parametru de interogare. Omiteți-l și apelul va acoperi întregul subarbore al chiriașului dvs.; trimiteți-l pentru a restrânge apelul la o singură organizație.
ID-ul organizației tale se află pe ecranul cheilor API din panoul de control, lângă cheia însăși. Este același ID în fiecare apel pe care îl faci.
Încearcă
Înlocuiți tot ce se află între paranteze unghiulare cu propriile valori și substituentul cheie cu o cheie din tabloul de bord.
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> }'Autentificat? Consola API din panoul de control îți completează ID-ul real al organizației și propria cheie și rulează cererea în API-ul live, astfel încât să poți vedea răspunsul efectiv. Deschideți acest punct final în consola API
Detalii
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`.
Parametri
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
org_id (query) | string | Nu | 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… |
Corp cerere
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
monitor_id | string | Da | — |
period_start | string | Da | Any instant in the calendar month being claimed; the month is derived from it. |
credit_percent | integer | Nu | 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… |
Răspuns
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
id | string | Da | — |
period_start | string | Da | — |
credit_percent | integer | Da | — |
amount_minor | integer | Da | The credit in integer minor units of `currency` (§2.8 — money is never a float). |
currency | string | Da | — |
outcome | string<measured, unadjudicable> | Da | Whether the month adjudicated, or the credit was granted because our coverage could not decide it. |
uptime_percent | string | Da | — |
created_at | string | Da | — |
Erori pe care le poate returna acest punct final
401 · 403 · 404 · 409 · 422