billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
Autenticación
Envía una clave de API como token de portador. Este endpoint no especifica un permiso concreto en la especificación, así que otorga a tu clave los mínimos privilegios necesarios y comprueba la respuesta en lugar de dar por sentado.
Donde va el ID de tu organización
Este endpoint acepta org_id como parámetro de consulta. Omítelo y la llamada abarcará todo tu subárbol de inquilinos; envíalo para acotar la llamada a una sola organización.
El id de tu organización se encuentra en la pantalla de claves de API en tu panel de control, junto a la propia clave. Es el mismo id en cada llamada que realices.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
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> }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
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
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
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… |
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
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… |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
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í | — |
Errores que este endpoint puede devolver
401 · 403 · 404 · 409 · 422