billing

POST /v1/sla/claims

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

Všechny koncové body billing

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ázevTypPožadovánoCo to je
org_id (query)stringNeNarrow 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ázevTypPožadovánoCo to je
monitor_idstringAno
period_startstringAnoAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerNeThe 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ázevTypPožadovánoCo to je
idstringAno
period_startstringAno
credit_percentintegerAno
amount_minorintegerAnoThe credit in integer minor units of `currency` (§2.8 — money is never a float).
currencystringAno
outcomestring<measured, unadjudicable>AnoWhether the month adjudicated, or the credit was granted because our coverage could not decide it.
uptime_percentstringAno
created_atstringAno

Chyby, které může tento koncový bod vrátit

401 · 403 · 404 · 409 · 422