billing

POST /v1/sla/claims

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

همه نقاط پایانی billing

احراز هویت

یک کلید 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_idstringبله
period_startstringبلهAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerخیر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…

پاسخ

نامنوعالزامیچیست
idstringبله
period_startstringبله
credit_percentintegerبله
amount_minorintegerبلهThe credit in integer minor units of `currency` (§2.8 — money is never a float).
currencystringبله
outcomestring<measured, unadjudicable>بلهWhether the month adjudicated, or the credit was granted because our coverage could not decide it.
uptime_percentstringبله
created_atstringبله

خطاهایی که این نقطه پایانی می‌تواند برگرداند

401 · 403 · 404 · 409 · 422