権利付与が作成、配送、失敗、または取り消された時にウェブフックエンドポイントに送信されるペイロードです。
Documentation Index
Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
Use this file to discover all available pages before exploring further.
| イベント | 説明 |
|---|---|
entitlement_grant.created | 新しい付与行が作成されました。ステータスはライセンスキーの場合は即座に delivered であり、その他の統合では pending です。 |
entitlement_grant.delivered | 付与が配信状態に移行しました。顧客は現在、権利を付与されたプラットフォーム、ファイル、またはライセンスキーへのアクセスを持っています。 |
entitlement_grant.failed | 配信が失敗し、再試行されていません。error_code と error_message を確認してください。 |
entitlement_grant.revoked | アクセスが取り消されました。理由を理解するために revocation_reason を確認してください。 |
EntitlementGrantResponse ペイロードを共有しています。
id があります。このイベントを使って、履行が進行中であることを記録します。
ライセンスキーの場合、行は直接 status: "delivered" と delivered_at が入力された状態で挿入され、単一の created イベントの後に、付与が後に取り消されない限り、さらなる状態変化はありません。
その他すべての統合の場合、行は status: "pending" で到着します。配信が完了すると、delivered または failed イベントが続きます:
oauth_url を含みます。顧客が承認するまで、付与は pending のままです。pending にあり、その後 delivered に移動します。pending から delivered へ移行しました。顧客は権利で示されるアクセスを現在持っています。このイベントを使用して、独自のシステム内で依存機能を解除するために使用します。例えば、ワークスペースのプロビジョニングやカスタムウェルカムメールの送信、「fulfilled」フラグの設定などです。
ペイロードの delivered_at フィールドは、配信が完了した時刻を記録します。作成時に delivered で到着した付与については、created と delivered イベントが連続して届きます。
error_code と error_message が失敗の原因を説明します。一般的な原因には、OAuthトークンの取り消し、プラットフォーム権限の拒否、またはターゲットの欠落(例:削除されたDiscordギルド)があります。
revocation_reason フィールドはトリガーを記録します。
revocation_reason | トリガー |
|---|---|
subscription_cancelled | 顧客のサブスクリプションがキャンセルされました(subscription.cancelled イベント)。 |
subscription_on_hold | サブスクリプションが失敗した更新のために保留中です(subscription.on_hold)。回復可能:成功した再試行は再付与を生む。 |
subscription_expired | サブスクリプションがその期間の終わりに達しました(subscription.expired)。 |
plan_changed | プランが変更されました。古い付与は新しいものが発行される前に取り消されます(subscription.plan_changed)。 |
refund | 元の一回払いの返金が処理されました(refund.succeeded)。 |
manual | 商人がAPIまたはダッシュボード経由で付与を取り消しました。手動の取り消しはサブスクリプション更新時に自動再付与されません。 |
license_key_disabled | ライセンスキーの後ろのライセンスキー付与が無効化されました。キーが再び有効になれば付与は自動的に再アクティブ化されます。 |
platform_external | 統合のプラットフォーム側が同期から外れました(例えば、Discord役割が手動で削除された、GitHubアプリはリポジトリアクセスを失った、または再調整パスは欠落したターゲットを検出した)。基礎的なプラットフォーム問題が解決されるまで、サブスクリプション更新時には自動再付与されません。 |
data フィールドは常に EntitlementGrantResponse オブジェクトです。2つの統合タイプが追加のネストオブジェクトを含みます:
license_key は、権利統合タイプが license_key である場合に含まれます。それは生成されたキー、有効期限、およびアクティベーション使用を含みます。digital_product_delivery は、統合タイプが digital_files である場合に含まれます。それは事前署名付きダウンロードURL、オプションの instructions、およびオプションの external_url を含んでいます。null です;関連構成は、付与自体ではなく、権利に記録されています。
entitlement_grant.delivered)entitlement_grant.delivered)entitlement_grant.created)entitlement_grant.revoked)entitlement_grant.failed)entitlement_grant.delivered を待ちます。 payment.succeeded イベントはお金がクリアされたことを伝えますが、顧客がGitHubリポジトリやDiscord役割をまだ持っていないことを伝えません。delivered イベントは、履行の真実の情報源です。revocation_reason を保持フローにマッピングします。 subscription_on_hold の取り消しは通常、顧客のカードが失敗し、次の更新が再付与することを意味します。manual または subscription_cancelled の取り消しは意図的です。顧客メッセージングで異なる扱いをしてください。id を冪等性キーとして使用します。 単一の付与は最大で1つの created イベント、最大で1つのターミナルイベント(delivered または failed)、最大で1つの revoked イベントを発します。ウェブフックシステムからの再配信はイベントを繰り返することがあります;付与の id と type で重複を排除してください。license_key と digital_product_delivery を検査して統合タイプを認識します。 付与ペイロード自体は統合タイプを保持しませんが、ライセンスキーおよびデジタルファイルの権利に対してこれらのネストされたオブジェクトのどちらか1つが含まれています。oauth_url を顧客に表示します。 Discord、GitHub、またはNotionのサブスクリバーフローのentitlement_grant.created イベントには、oauth_url と oauth_expires_at が含まれます。お客様にメールしたり、アプリ内に表示して配信を解除してください。Detailed view of a single entitlement grant: who it's for, its lifecycle state, and any integration-specific delivery payload.
Identifier of the business that owns the grant.
Timestamp when the grant was created.
Identifier of the customer the grant was issued to.
Identifier of the entitlement this grant was issued from.
Unique identifier of the grant.
Arbitrary key-value metadata recorded on the grant.
Lifecycle status of the grant.
Pending, Delivered, Failed, Revoked Timestamp when the grant was last modified.
Timestamp when the grant transitioned to delivered, when applicable.
Digital-product-delivery payload, present when the entitlement
integration is digital_files.
Machine-readable code reported when delivery failed, when applicable.
Human-readable message reported when delivery failed, when applicable.
License-key delivery payload, present when the entitlement integration
is license_key.
Timestamp when oauth_url stops being valid, when applicable.
Customer-facing OAuth URL for OAuth-style integrations. Populated
during the customer-portal accept flow; null until the customer
completes that step, and on grants for non-OAuth integrations.
Identifier of the payment that triggered this grant, when applicable.
Reason recorded when the grant was revoked, when applicable.
Timestamp when the grant transitioned to revoked, when applicable.
Identifier of the subscription that triggered this grant, when applicable.