billing
POST /v1/sla/claims
Claim the service credit for one monitored site's month.
אימות
שלח מפתח API כטוקן Bearer. נקודת קצה זו אינה מציינת הרשאת ספציפית במפרט, לכן הקצה למפתח שלך את המינימום הנדרש ובדוק את התגובה במקום להניח הנחות.
המקום שבו מזהה הארגון שלך נכנס
נקודת קצה זו מקבלת את org_id כפרמטר שאילתת חיפוש. השאר אותו ריק והקריאה תכסה את כל תת-עץ הדיירות שלך; שלח אותו כדי לצמצם את הקריאה לארגון אחד.
מזהה הארגון שלך נמצא במסוף מפתחות ה-API בלוח הבקרה שלך, לצד המפתח עצמו. זהו אותו מזהה בכל קריאה שאתה מבצע.
נסה זאת
החלף כל דבר בסוגריים זוויתיים בערכים משלך, ואת מציין מיקום המפתח במפתח מלוח הבקרה שלך.
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> }'מחובר? קונסולת ה-API בלוח הבקרה שלך מזינה את מזהה הארגון האמיתי שלך ואת המפתח שלך, ומריצה את הבקשה מול ה-API הפיזי כך שתוכל לראות את התגובה בפועל. פתח נקודת קצה זו במסוף ה-API
פרטים
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`.
פרמטרים
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
org_id (query) | string | לא | 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… |
גוף הבקשה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
monitor_id | string | כן | — |
period_start | string | כן | Any instant in the calendar month being claimed; the month is derived from it. |
credit_percent | integer | לא | 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… |
תשובה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
id | string | כן | — |
period_start | string | כן | — |
credit_percent | integer | כן | — |
amount_minor | integer | כן | The credit in integer minor units of `currency` (§2.8 — money is never a float). |
currency | string | כן | — |
outcome | string<measured, unadjudicable> | כן | Whether the month adjudicated, or the credit was granted because our coverage could not decide it. |
uptime_percent | string | כן | — |
created_at | string | כן | — |
שגיאות שנקודה קצה זו עשויה להחזיר
401 · 403 · 404 · 409 · 422