billing

POST /v1/sla/claims

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

すべての billing エンドポイント

認証

ベアラー トークンとして API キーを送信します。このエンドポイントでは仕様に特定の権限が記載されていないため、キーに必要な最小限の権限を付与し、推測するのではなくレスポンスを確認してください。

組織 ID を入力する場所

このエンドポイントはクエリパラメータとして org_id を受け取ります。省略した場合はテナントサブツリー全体が対象になり、指定した場合は特定の組織のみに絞り込まれます。

組織IDは、ダッシュボードのAPIキー画面にキーのすぐ横に表示されています。これは、実行するすべての呼び出しで同じIDになります。

試してみる

アングルブラケット内のすべてをご自身の値に置き換え、キーのプレースホルダーをご利用中のダッシュボードのキーに置き換えてください。

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コンソールでは、実際の組織IDやお客様ご自身のキーが自動入力され、ライブ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