billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
Autenticazione
Invia una chiave API come bearer token. Questo endpoint non specifica un permesso specifico nella specifica, quindi assegna alla tua chiave i permessi minimi necessari e verifica la risposta invece di fare supposizioni.
L'ID della tua organizzazione va qui
Questo endpoint accetta org_id come parametro di query. Omettilo e la chiamata coprirà l'intero sottoalbero del tuo tenant; invialo per limitare la chiamata a una singola organizzazione.
L'identificativo della tua organizzazione si trova nella schermata delle chiavi API nella tua dashboard, accanto alla chiave stessa. È lo stesso identificativo in ogni chiamata che effettui.
Provalo
Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua 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> }'Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API
Dettagli
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
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
org_id (query) | string | No | 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… |
Corpo della richiesta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
monitor_id | string | Sì | — |
period_start | string | Sì | Any instant in the calendar month being claimed; the month is derived from it. |
credit_percent | integer | No | 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… |
Risposta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
id | string | Sì | — |
period_start | string | Sì | — |
credit_percent | integer | Sì | — |
amount_minor | integer | Sì | The credit in integer minor units of `currency` (§2.8 — money is never a float). |
currency | string | Sì | — |
outcome | string<measured, unadjudicable> | Sì | Whether the month adjudicated, or the credit was granted because our coverage could not decide it. |
uptime_percent | string | Sì | — |
created_at | string | Sì | — |
Errori che questo endpoint può restituire
401 · 403 · 404 · 409 · 422