billing

POST /v1/sla/claims

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

Tất cả các điểm cuối billing

Xác thực

Gửi khóa API dưới dạng mã thông báo bearer. Điểm cuối này không nêu rõ quyền cụ thể trong thông số kỹ thuật, vì vậy hãy cấp cho khóa của bạn quyền tối thiểu cần thiết và kiểm tra phản hồi thay vì phỏng đoán.

Nơi điền id tổ chức của bạn

Điểm cuối này nhận org_id làm tham số truy vấn. Hãy bỏ trống để áp dụng cho toàn bộ cây thuê của bạn; hoặc truyền giá trị vào để thu hẹp phạm vi gọi về một tổ chức duy nhất.

Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.

Dùng thử

Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.

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

Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API

Chi tiết

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

Tham số

TênLoạiBắt buộcNội dung này là gì
org_id (query)stringKhôngNarrow 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…

Nội dung yêu cầu

TênLoạiBắt buộcNội dung này là gì
monitor_idstring
period_startstringAny instant in the calendar month being claimed; the month is derived from it.
credit_percentintegerKhôngThe 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…

Phản hồi

TênLoạiBắt buộcNội dung này là gì
idstring
period_startstring
credit_percentinteger
amount_minorintegerThe 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

Các lỗi điểm cuối này có thể trả về

401 · 403 · 404 · 409 · 422