billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
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
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
org_id (query) | string | Não | 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 da requisição
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
monitor_id | string | Sim | — |
period_start | string | Sim | Any instant in the calendar month being claimed; the month is derived from it. |
credit_percent | integer | Não | 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… |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
id | string | Sim | — |
period_start | string | Sim | — |
credit_percent | integer | Sim | — |
amount_minor | integer | Sim | The credit in integer minor units of `currency` (§2.8 — money is never a float). |
currency | string | Sim | — |
outcome | string<measured, unadjudicable> | Sim | Whether the month adjudicated, or the credit was granted because our coverage could not decide it. |
uptime_percent | string | Sim | — |
created_at | string | Sim | — |
Erros que este endpoint pode retornar
401 · 403 · 404 · 409 · 422