billing

POST /v1/sla/claims

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

Todos os endpoints de billing

Autenticação

Envie uma chave de API como um token bearer. Este endpoint não especifica uma permissão específica na documentação, portanto, conceda à sua chave o mínimo necessário e verifique a resposta em vez de assumir.

Onde vai o ID da sua organização

Este endpoint aceita org_id como parâmetro de consulta. Omita-o e a chamada abrangerá toda a sua subárvore de locatários; envie-o para restringir a chamada a uma única organização.

O ID da sua organização está na tela de chaves de API no seu painel, ao lado da própria chave. É o mesmo ID em todas as chamadas que você fizer.

Experimente

Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.

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

Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API

Detalhes

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

Parâmetros

NomeTipoObrigatórioO que é
org_id (query)stringNãoNarrow 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 da requisição

NomeTipoObrigatórioO que é
monitor_idstringSim
period_startstringSimAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerNãoThe 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…

Resposta

NomeTipoObrigatórioO que é
idstringSim
period_startstringSim
credit_percentintegerSim
amount_minorintegerSimThe credit in integer minor units of `currency` (§2.8 — money is never a float).
currencystringSim
outcomestring<measured, unadjudicable>SimWhether the month adjudicated, or the credit was granted because our coverage could not decide it.
uptime_percentstringSim
created_atstringSim

Erros que este endpoint pode retornar

401 · 403 · 404 · 409 · 422