मुख्य सामग्री पर जाएं

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.

प्राधिकार अनुदान वेबहुक घटनाएँ

जब भी किसी ग्राहक का प्राधिकार अनुदान स्थिति बदलता है, उदाहरण के लिए जब एक लाइसेंस कुंजी उत्पन्न होती है, एक Discord भूमिका आवंटित होती है, एक डाउनलोड लिंक प्रदान किया जाता है, या पहुंच निरस्त होती है, तो ये घटनाएँ चलती हैं। इन घटनाओं की सदस्यता लें ताकि आपका एप्लिकेशन इस बात के साथ तालमेल में रहे कि प्रत्येक ग्राहक को क्या पहुंच सकता है।
घटनाविवरण
entitlement_grant.createdएक नया अनुदान पंक्ति बनाई गई। लाइसेंस कुंजियों के लिए स्थिति तुरंत delivered होती है, और प्रत्येक अन्य एकीकरण के लिए pending होती है।
entitlement_grant.deliveredअनुदान वितरित होने की ओर प्रगति करता है। अब ग्राहक को प्राधिकृत प्लेटफ़ॉर्म, फ़ाइल, या लाइसेंस कुंजी तक पहुँच प्राप्त हो गई है।
entitlement_grant.failedडिलीवरी विफल हुई है और पुनः प्रयास नहीं किया जा रहा है। error_code और error_message देखें।
entitlement_grant.revokedपहुंच वापस ले ली गई। कारण समझने के लिए revocation_reason देखें।
सभी चार घटनाएँ नीचे दी गई स्कीमा में प्रलेखित समान EntitlementGrantResponse पेलोड साझा करती हैं।

घटना ट्रिगर

entitlement_grant.created

एक अनुदान पंक्ति अभी-अभी डाली गई। इस बिंदु से अनुदान के पास हमेशा एक स्थिर id होता है, भले ही उसकी स्थिति बदल जाए। यह रिकॉर्ड करने के लिए इस घटना का उपयोग करें कि पूर्ति प्रगति पर है। लाइसेंस कुंजियों के लिए, पंक्ति सीधे status: "delivered" और delivered_at के साथ डाली जाती है, इसलिए एक एकल created घटना का पालन किसी भी आगे की स्थिति में परिवर्तन नहीं किया जाता है जब तक कि अनुदान बाद में रद्द नहीं किया जाता है। हर अन्य एकीकरण के लिए पंक्ति status: "pending" के साथ आती है। डिलीवरी पूरी होते ही एक delivered या failed घटना का पालन करें:
  • OAuth आधारित एकीकरण (Discord, GitHub, Notion) ग्राहक को सहमति पूरी करने के लिए एक oauth_url शामिल करते हैं। जब तक ग्राहक अनुमति नहीं देता, अनुदान pending रहेगा।
  • प्लेटफ़ॉर्म-प्रत्यक्ष एकीकरण (Telegram, Framer, Digital Files) केवल तभी तक pending में रहते हैं जब तक प्लेटफ़ॉर्म कॉल चलता है, फिर delivered पर चले जाते हैं।

entitlement_grant.delivered

अनुदान pending से delivered पर स्थानांतरित हो गया। अब ग्राहक के पास प्राधिकार में वर्णित पहुंच है। अपने सिस्टम में निर्भर सुविधाओं को अनलॉक करने के लिए इस घटना का उपयोग करें, उदाहरण के लिए एक कार्यस्थल प्रदान करने के लिए, एक कस्टम स्वागत ईमेल भेजने के लिए, या एक “पूर्ण” ध्वज चिह्नित करने के लिए। पेलोड का delivered_at फ़ील्ड दर्शाता है कि डिलीवरी कब पूरी हुई। उन अनुदानों के लिए जो निर्माण पर delivered पहुंचे, आपको created और delivered घटनाएं क्रम-शः प्राप्त होंगी।

entitlement_grant.failed

डिलीवरी का प्रयास किया गया और एक गैर-पुनः प्रयास योग्य त्रुटि के साथ विफल हो गया। error_code और error_message फ़ील्ड असफलता की व्याख्या करते हैं। सामान्य कारणों में एक निरस्त OAuth टोकन, एक इनकार किया गया प्लेटफ़ॉर्म अनुमति, या एक गायब लक्ष्य (जैसे, एक हटाया गया Discord गिल्ड) शामिल हैं।
entitlement_grant.failed को कार्रवाई योग्य मानें। ग्राहक ने भुगतान किया लेकिन पहुंच प्राप्त नहीं की। अपनी सहायता टीम को असफलताओं को उजागर करें या जैसे ही अंतर्निहित समस्या हल हो जाए, एक पुनः अनुदान को ट्रिगर करें।

entitlement_grant.revoked

प्लेटफ़ॉर्म स्तर पर पहुंच वापस ले ली गई: Discord भूमिका हटा दी गई, GitHub सहयोगी हटा दिया गया, लाइसेंस कुंजी अक्षम कर दी गई, फ़ाइल डाउनलोड URL अब जारी नहीं किए गए। ट्रिगर रिकॉर्ड करने वाले 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एक व्यापारी ने एपीआई या डैशबोर्ड के माध्यम से अनुदान रद्द कर दिया। मैन्युअल निरसन सदस्यता नवीनीकरण पर स्वचालित रूप से पुनः अनुदान नहीं दिया जाता है।
license_key_disabledलाइसेंस-कुंजी अनुदान के पीछे की लाइसेंस कुंजी अक्षम कर दी गई थी। यदि कुंजी को फिर से सक्षम किया जाता है तो अनुदान स्वचालित रूप से पुनः सक्रिय हो जाता है।
platform_externalएकीकरण का प्लेटफ़ॉर्म साइड तालमेल से बाहर हो गया (उदाहरण के लिए, एक Discord भूमिका मैन्युअल रूप से हटा दी गई थी, GitHub ऐप ने रेपॉजिटरी पहुंच खो दी थी, या पुनः संतुलन पास ने एक गायब लक्ष्य का पता लगाया)। जब तक अंतर्निहित प्लेटफ़ॉर्म समस्या हल नहीं होती, तब तक अनुदान सदस्यता नवीनीकरण पर स्वचालित रूप से पुनः अनुदान नहीं दिया जाता।

पेलोड प्रकार

data फ़ील्ड हमेशा एक EntitlementGrantResponse वस्तु होता है। दो एकीकरण प्रकार अतिरिक्त नेस्टेड ऑब्जेक्ट्स संलग्न करते हैं:
  • license_key तब शामिल होता है जब प्राधिकरण एकीकरण प्रकार license_key होता है। इसमें उत्पन्न कुंजी, समाप्ति, और सक्रियण उपयोग शामिल होता है।
  • digital_product_delivery तब शामिल होता है जब एकीकरण प्रकार digital_files होता है। इसमें प्रेसाइनड डाउनलोड URL, वैकल्पिक instructions, और वैकल्पिक external_url शामिल होता है।
अन्य सभी एकीकरण प्रकारों (Discord, GitHub, Telegram, Framer, Notion) के लिए दोनों फ़ील्ड null होते हैं; प्रासंगिक कॉन्फिगरेशन अनुदान में नहीं, बल्कि प्राधिकरण में ही कैप्चर किया जाता है।

नमूना पेलोड

लाइसेंस कुंजी वितरित (entitlement_grant.delivered)

{
  "business_id": "bus_H4ekzPSlcg",
  "type": "entitlement_grant.delivered",
  "timestamp": "2026-05-01T10:25:33.000000Z",
  "data": {
    "id": "grant_8VbC6JDZzPEqfBPUdpj0K",
    "business_id": "bus_H4ekzPSlcg",
    "entitlement_id": "ent_9xY2bKwQn5MjRpL8d",
    "customer_id": "cus_abc123",
    "external_id": "lk_AAA111BBB222",
    "payment_id": "pay_a1b2c3d4",
    "subscription_id": null,
    "status": "delivered",
    "license_key": {
      "key": "PRO-AAAA-BBBB-CCCC-DDDD",
      "expires_at": "2027-05-01T00:00:00Z",
      "activations_used": 0,
      "activations_limit": 5
    },
    "digital_product_delivery": null,
    "delivered_at": "2026-05-01T10:25:33Z",
    "revoked_at": null,
    "revocation_reason": null,
    "error_code": null,
    "error_message": null,
    "oauth_url": null,
    "oauth_expires_at": null,
    "metadata": null,
    "created_at": "2026-05-01T10:25:33Z",
    "updated_at": "2026-05-01T10:25:33Z"
  }
}

डिजिटल फाइलें वितरित (entitlement_grant.delivered)

{
  "business_id": "bus_H4ekzPSlcg",
  "type": "entitlement_grant.delivered",
  "timestamp": "2026-05-01T10:30:12.000000Z",
  "data": {
    "id": "grant_2P9rQwYvMxTnKoCb4",
    "business_id": "bus_H4ekzPSlcg",
    "entitlement_id": "ent_files_J3kLmN4oP5",
    "customer_id": "cus_abc123",
    "external_id": "pay_a1b2c3d4",
    "payment_id": "pay_a1b2c3d4",
    "subscription_id": null,
    "status": "delivered",
    "license_key": null,
    "digital_product_delivery": {
      "files": [
        {
          "file_id": "df_a4f6c1de",
          "download_url": "https://files.dodopayments.com/.../pro-bundle.zip?Signature=...",
          "filename": "pro-bundle.zip",
          "content_type": "application/zip",
          "file_size": 18742390,
          "expires_in": 900
        }
      ],
      "instructions": "Unzip and run setup.sh from the project root.",
      "external_url": null
    },
    "delivered_at": "2026-05-01T10:30:12Z",
    "revoked_at": null,
    "revocation_reason": null,
    "error_code": null,
    "error_message": null,
    "oauth_url": null,
    "oauth_expires_at": null,
    "metadata": null,
    "created_at": "2026-05-01T10:30:12Z",
    "updated_at": "2026-05-01T10:30:12Z"
  }
}

Discord भूमिका बनाई गई और लंबित (entitlement_grant.created)

{
  "business_id": "bus_H4ekzPSlcg",
  "type": "entitlement_grant.created",
  "timestamp": "2026-05-01T10:31:00.000000Z",
  "data": {
    "id": "grant_DiscordPending5L",
    "business_id": "bus_H4ekzPSlcg",
    "entitlement_id": "ent_discord_patrons",
    "customer_id": "cus_abc123",
    "external_id": "sub_pro_monthly_001",
    "payment_id": null,
    "subscription_id": "sub_pro_monthly_001",
    "status": "pending",
    "license_key": null,
    "digital_product_delivery": null,
    "delivered_at": null,
    "revoked_at": null,
    "revocation_reason": null,
    "error_code": null,
    "error_message": null,
    "oauth_url": "https://discord.com/oauth2/authorize?...",
    "oauth_expires_at": "2026-05-08T10:31:00Z",
    "metadata": null,
    "created_at": "2026-05-01T10:31:00Z",
    "updated_at": "2026-05-01T10:31:00Z"
  }
}

सदस्यता रद्दीकरण पर अनुदान रद्द (entitlement_grant.revoked)

{
  "business_id": "bus_H4ekzPSlcg",
  "type": "entitlement_grant.revoked",
  "timestamp": "2026-06-15T08:12:44.000000Z",
  "data": {
    "id": "grant_8VbC6JDZzPEqfBPUdpj0K",
    "business_id": "bus_H4ekzPSlcg",
    "entitlement_id": "ent_9xY2bKwQn5MjRpL8d",
    "customer_id": "cus_abc123",
    "external_id": "sub_pro_monthly_001",
    "payment_id": null,
    "subscription_id": "sub_pro_monthly_001",
    "status": "revoked",
    "revocation_reason": "subscription_cancelled",
    "license_key": {
      "key": "PRO-AAAA-BBBB-CCCC-DDDD",
      "expires_at": null,
      "activations_used": 1,
      "activations_limit": 5
    },
    "digital_product_delivery": null,
    "delivered_at": "2026-05-01T10:25:33Z",
    "revoked_at": "2026-06-15T08:12:44Z",
    "error_code": null,
    "error_message": null,
    "oauth_url": null,
    "oauth_expires_at": null,
    "metadata": null,
    "created_at": "2026-05-01T10:25:33Z",
    "updated_at": "2026-06-15T08:12:44Z"
  }
}

डिलीवरी विफल (entitlement_grant.failed)

{
  "business_id": "bus_H4ekzPSlcg",
  "type": "entitlement_grant.failed",
  "timestamp": "2026-05-01T10:36:21.000000Z",
  "data": {
    "id": "grant_GhFailed7Z",
    "business_id": "bus_H4ekzPSlcg",
    "entitlement_id": "ent_github_repo",
    "customer_id": "cus_abc123",
    "external_id": "pay_a1b2c3d4",
    "payment_id": "pay_a1b2c3d4",
    "subscription_id": null,
    "status": "failed",
    "license_key": null,
    "digital_product_delivery": null,
    "delivered_at": null,
    "revoked_at": null,
    "revocation_reason": null,
    "error_code": "github_permission_denied",
    "error_message": "Repository access could not be granted: the GitHub App installation no longer has permission on this repository.",
    "oauth_url": null,
    "oauth_expires_at": null,
    "metadata": null,
    "created_at": "2026-05-01T10:36:00Z",
    "updated_at": "2026-05-01T10:36:21Z"
  }
}

एकीकरण सुझाव

  • निर्भर सुविधाओं को अनलॉक करने से पहले entitlement_grant.delivered की प्रतीक्षा करें। एक payment.succeeded घटना आपको बताती है कि पैसे साफ हो गए हैं; यह आपको यह नहीं बताती है कि ग्राहक के पास अभी तक GitHub रेपो या Discord भूमिका है। पूर्ति के लिए delivered घटना सत्य का स्रोत है।
  • revocation_reason को प्रतिधारण प्रवाहों से मैप करें। एक subscription_on_hold रद्दीकरण आमतौर पर दर्शाता है कि ग्राहक का कार्ड विफल हो गया और अगला नवीनीकरण पहुंच पुनः अनुदान करेगा। एक manual या subscription_cancelled रद्दीकरण जानबूझकर है। ग्राहक संदेश में उन्हें अलग तरीके से व्यवहार करें।
  • अपने आइडेमपोटेंसी कुंजी के रूप में अनुदान id का उपयोग करें। एक एकल अनुदान एक से अधिक created घटना का उत्सर्जन करता है और अधिकतम एक टर्मिनल घटना (delivered या failed), और अधिकतम एक revoked घटना। वेबहुक सिस्टम से पुनर्प्रेषण घटनाओं को दोहरा सकता है; अनुदान id प्लस type पर डीडुप करें।
  • एकीकरण प्रकार को पहचानने के लिए license_key और digital_product_delivery का निरीक्षण करें। अनुदान पेलोड स्वयं एकीकरण प्रकार नहीं ले जाता है, लेकिन लाइसेंस-कुंजी और डिजिटल-फाइल्स प्राधिकरण के लिए इन नेस्टेड ऑब्जेक्ट्स में से एक को ही भरा जाता है।
  • OAuth-आधारित अनुदानों के लिए, ग्राहक को 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.

business_id
string
आवश्यक

Identifier of the business that owns the grant.

created_at
string<date-time>
आवश्यक

Timestamp when the grant was created.

customer_id
string
आवश्यक

Identifier of the customer the grant was issued to.

entitlement_id
string
आवश्यक

Identifier of the entitlement this grant was issued from.

id
string
आवश्यक

Unique identifier of the grant.

metadata
object
आवश्यक

Arbitrary key-value metadata recorded on the grant.

status
enum<string>
आवश्यक

Lifecycle status of the grant.

उपलब्ध विकल्प:
Pending,
Delivered,
Failed,
Revoked
updated_at
string<date-time>
आवश्यक

Timestamp when the grant was last modified.

delivered_at
string<date-time> | null

Timestamp when the grant transitioned to delivered, when applicable.

digital_product_delivery
Digital Product Delivery · object

Digital-product-delivery payload, present when the entitlement integration is digital_files.

error_code
string | null

Machine-readable code reported when delivery failed, when applicable.

error_message
string | null

Human-readable message reported when delivery failed, when applicable.

license_key
object

License-key delivery payload, present when the entitlement integration is license_key.

oauth_expires_at
string<date-time> | null

Timestamp when oauth_url stops being valid, when applicable.

oauth_url
string | null

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.

payment_id
string | null

Identifier of the payment that triggered this grant, when applicable.

revocation_reason
string | null

Reason recorded when the grant was revoked, when applicable.

revoked_at
string<date-time> | null

Timestamp when the grant transitioned to revoked, when applicable.

subscription_id
string | null

Identifier of the subscription that triggered this grant, when applicable.

Last modified on May 14, 2026