billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
Autentizace
Odešlete klíč API jako bearer token. Tento koncový bod ve specifikaci uvádí specifické oprávnění, takže svému klíči udělte to nejmenší možné a místo předpokladů zkontrolujte odpověď.
Sem patří ID vaší organizace
Tento koncový bod přijímá org_id jako parametr dotazu. Pokud ho vynecháte, volání pokryje celý podstrom vašeho nájemce; jeho odesláním volání zúžíte na jednu organizaci.
ID vaší organizace najdete na obrazovce API klíčů ve vašem přehledu, hned vedle samotného klíče. Je to stále stejné ID v každém volání, které provedete.
Vyzvednout
Nahraďte cokoli v závorkách vlastními hodnotami a zástupný symbol klíče klíčem z vašeho řídicího panelu.
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> }'Přihlášeni? Konzole API ve vašem dashboardu automaticky doplní vaše skutečné ID organizace i váš vlastní klíč a odešle požadavek na živé API, abyste viděli reálnou odpověď. Otevřete tento koncový bod v konzoli API
Podrobnosti
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
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
org_id (query) | string | Ne | 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… |
Tělo požadavku
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
monitor_id | string | Ano | — |
period_start | string | Ano | Any instant in the calendar month being claimed; the month is derived from it. |
credit_percent | integer | Ne | 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… |
Odpověď
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
id | string | Ano | — |
period_start | string | Ano | — |
credit_percent | integer | Ano | — |
amount_minor | integer | Ano | The credit in integer minor units of `currency` (§2.8 — money is never a float). |
currency | string | Ano | — |
outcome | string<measured, unadjudicable> | Ano | Whether the month adjudicated, or the credit was granted because our coverage could not decide it. |
uptime_percent | string | Ano | — |
created_at | string | Ano | — |
Chyby, které může tento koncový bod vrátit
401 · 403 · 404 · 409 · 422