जब ग्राहक भुगतान करें, तो license keys, डाउनलोड करने योग्य फ़ाइलें, feature flags और Discord, GitHub, Telegram, Framer तथा Notion का access अपने-आप प्रदान करें।
Entitlements सफल भुगतान या active subscription को access में बदलते हैं: आपके customer के inbox में license key, जिसे आपका app जाँचता है ऐसा feature flag, Discord role, GitHub repository, Notion template, Framer remix link, Telegram chat invite या डाउनलोड करने योग्य file bundle। भुगतान lifecycle बदलने पर Dodo Payments उस access को अपने-आप जारी, track और revoke करता है।
The Entitlements dashboard. Each entitlement is a reusable template; the right pane shows individual customer grants.
एक entitlement उस चीज़ की पुन: उपयोग योग्य परिभाषा है जिसे आप customer को प्रदान करते हैं, जैसे Pro license key, “Patrons” Discord role, आपकी private GitHub repository का access या डाउनलोड करने योग्य e-book bundle। आप entitlements को products से जोड़ते हैं और customer के भुगतान करने पर Dodo Payments उन्हें प्रदान करता है।जब कोई customer product खरीदता है, तो Dodo Payments एक grant बनाता है: उस entitlement को एक customer को जारी करना। Grant की चार में से एक status होती है: डिलीवरी जारी रहने के दौरान Pending, customer को access मिल जाने पर Delivered, डिलीवरी पूरी न हो पाने पर Failed, और access वापस लिए जाने पर Revoked।
Entitlements fulfillment को नियंत्रित करते हैं (क्या customer के पास access है?)। Credits consumption को नियंत्रित करते हैं (वे इसका कितना उपयोग कर सकते हैं?)। आप दोनों को एक ही product से जोड़ सकते हैं। Credits के लिए Credit-Based Billing देखें।
हर entitlement एक integration के माध्यम से डिलीवर होता है। आप जो बेचते हैं, उसके अनुरूप integration चुनें।
License Keys
Generate unique license keys with activation limits and expiry. Best for software, plugins, and CLIs.
Digital Files
E-books, templates और media जैसी डाउनलोड करने योग्य फ़ाइलें presigned download URLs और वैकल्पिक निर्देशों के साथ डिलीवर करें।
Feature Flags
Purchase के आधार पर अपने app में features को नियंत्रित करें। Creation के समय डिलीवर किया जाता है, API के माध्यम से जाँचा जाता है और cancellation पर revoke किया जाता है।
Discord
Customer के खरीदने पर उसे अपने Discord server में एक role दें। Cancellation पर role अपने-आप हटा दिया जाता है।
GitHub
Add customers as collaborators to a private repository at the permission level you choose.
Telegram
Add customers to a private Telegram chat or channel after purchase.
Framer
Unlock a Framer template remix link for paying customers.
Notion
Duplicate a Notion template into the customer’s workspace on purchase.
Grants उन्हीं payment और subscription events का अनुसरण करते हैं जो आपको webhooks के रूप में प्राप्त होते हैं। Dodo Payments payment lifecycle के आधार पर purchases के लिए grants अपने-आप बनाता और revoke करता है, इसलिए आपको grant API को स्वयं call करने की आवश्यकता नहीं है।
Dodo Payments payment पूरा होने या subscription active होने पर grant बनाता है। Feature-flag grants की शुरुआत Delivered से होती है। License-key grants की भी शुरुआत Delivered से होती है, जब entitlement में fulfillment_mode: auto (default) का उपयोग किया जाता है। fulfillment_mode: manual के अंतर्गत grant की शुरुआत Pending से होती है और तब तक कोई key नहीं होती जब तक आप Fulfill License Key Grant के माध्यम से एक key प्रदान नहीं करते। हर अन्य integration की शुरुआत Pending से होती है।OAuth-based integrations (Discord, GitHub, Notion) एक oauth_url उपलब्ध कराते हैं, जिस पर customer consent देने के लिए जाता है। Grant बनाते समय Dodo Payments इस URL को generate करने का प्रयास करता है। यदि यह विफल होता है, तो field null ही रहता है, जब तक customer अपनी delivery email या Customer Portal से accept flow शुरू नहीं करता। Platform-direct integrations (Telegram, Framer, Digital Files) केवल provisioning के दौरान Pending रहते हैं, फिर Delivered में बदल जाते हैं।
2
Delivered
डिलीवरी पूरी होने पर grant Delivered में बदल जाता है और delivered_at सेट हो जाता है। डिलीवरी तब पूरी मानी जाती है जब license key generate हो जाती है, role assign हो जाता है, repository access मिल जाता है, file links resolve हो जाते हैं या OAuth flow पूरा हो जाता है।
3
Failed
यदि integration call non-retryable error लौटाता है, जैसे revoked OAuth token, denied permission या ऐसी file जो अब मौजूद नहीं है, तो grant Failed में बदल जाता है। error_code और error_message fields कारण दर्ज करते हैं।
4
Revoked
जब access वापस लिया जाता है, उदाहरण के लिए subscription cancel होने, refund जारी होने या आपके द्वारा grant revoke करने पर, grant Revoked में बदल जाता है। revocation_reason field trigger दर्ज करता है।
हर payment और subscription event grants को इस प्रकार बदलता है:
Event
व्यवहार
payment.succeeded (one-time payment)
संलग्न प्रत्येक entitlement के लिए एक grant जारी करता है। License Key entitlement प्रत्येक key के लिए एक grant जारी करता है।
payment.succeeded (subscription-linked payment)
कोई बदलाव नहीं। नीचे दिए गए subscription events इन grants को संचालित करते हैं।
subscription.active
ऐसे संलग्न entitlements के लिए grants जारी करता है जिनके पास अभी कोई grant नहीं है, और उसी subscription के लिए पहले revoke किए गए grants को फिर से grant करता है। manual, refund या platform_external से revoke किए गए grants फिर से grant नहीं किए जाते।
subscription.renewed
कोई बदलाव नहीं। Existing grants renewals के दौरान बने रहते हैं।
subscription.past_due
कोई बदलाव नहीं। Grants पूरे grace period के दौरान delivered रहते हैं।
subscription.on_hold
revocation_reason: subscription_on_hold वाले सभी delivered और pending grants को revoke करता है।
subscription.paused
revocation_reason: SubscriptionPaused वाले सभी delivered और pending grants को revoke करता है। अन्य subscription reasons के विपरीत, यह value PascalCase का उपयोग करती है, इसलिए इसका ठीक-ठीक मिलान करें।
subscription.unpaused
उसी subscription के लिए पहले revoke किए गए grants को फिर से grant करता है, ठीक उसी तरह जैसे subscription.active करता है।
subscription.cancelled
revocation_reason: subscription_cancelled वाले सभी grants को revoke करता है।
subscription.expired
revocation_reason: subscription_expired वाले सभी grants को revoke करता है।
subscription.plan_changed
revocation_reason: plan_changed वाले सभी current grants को revoke करता है, फिर नए plan के entitlements के लिए grants जारी करता है।
refund.succeeded (one-time payment)
उस payment के grants को revocation_reason: refund के साथ revoke करता है।
Manual API revoke
revocation_reason: manual वाले grant को revoke करता है। Manual revokes subscription renewal पर अपने-आप फिर से grant नहीं किए जाते।
License key disabled
License-key grants के लिए, underlying key को disable करने पर grant revocation_reason: license_key_disabled के साथ revoke हो जाता है। Key को फिर से enable करने पर grant अपने-आप restore हो जाता है।
Platform drift detected
यदि integration का platform side sync से बाहर हो जाता है, जैसे Discord role को manually हटाना, GitHub App का repository access खो देना या reconciliation pass में missing target मिलना, तो Dodo Payments grant को revocation_reason: platform_external के साथ revoke करता है। Platform issue हल होने तक subscription renewal पर इसे अपने-आप फिर से grant नहीं किया जाता।
Subscription-driven grants प्रति (entitlement, customer, subscription) idempotent होते हैं, इसलिए renewals और re-activations duplicate grants नहीं बनाते। One-time grants प्रति (entitlement, customer, payment) idempotent होते हैं।
Dashboard में Entitlements पर जाएँ और entitlement बनाने के लिए + पर click करें।
2
Pick an Integration
Integration type चुनें: License Key, Digital Files, Feature Flag, Discord, GitHub, Telegram, Figma, Framer या Notion। Platform integration के लिए, यदि आपने पहले से connect नहीं किया है तो पहले अपना account connect करें।
3
Configure Delivery
Integration के fields भरें। उदाहरण के लिए, GitHub repository और permission level माँगता है, Discord server और optional role माँगता है, और License Key activations limit तथा license length माँगता है।
Creating a GitHub entitlement. Each integration shows the fields it needs.
4
Save
Create Entitlement पर click करें। अब आप entitlement को किसी भी product से attach कर सकते हैं।
Product खोलें, उसके Entitlements section पर जाएँ और product खरीदे जाने पर डिलीवर किए जाने वाले entitlements चुनें। एक product एक साथ कई entitlements डिलीवर कर सकता है। उदाहरण के लिए, Pro plan में license key, GitHub access और Discord role शामिल हो सकते हैं।
Attaching entitlements to a product. Selected entitlements are delivered on every successful purchase or active subscription.
Purchase के बाद customer को delivery email मिलती है, जिसमें product के entitlements पर लागू license key, download links, OAuth invitation links या platform invite होता है। Grant active रहने तक यही विवरण Customer Portal में उनके order history के अंतर्गत भी उपलब्ध रहते हैं।
Discord, GitHub और Notion subscriber access के लिए customer को Dodo Payments को वह access देने की अनुमति देनी होती है। ये grants तब तक Pending रहते हैं जब तक customer अपनी email या Customer Portal के link से OAuth flow पूरा नहीं करता। Customer के authorize करने के बाद grant Delivered में बदल जाता है और Dodo Payments platform access provision करता है।
जब कोई grant revoke किया जाता है, तो Dodo Payments platform पर access हटा देता है: Discord role हटाता है, GitHub collaborator हटाता है या license key disable करता है। Customer को यह बदलाव Customer Portal में दिखाई देता है।
Digital Files के लिए, revocation नए presigned download URLs को रोकता है, लेकिन customer द्वारा पहले से download की गई copies को invalid नहीं करता। इसे ध्यान में रखते हुए अपने content gating की योजना बनाएँ।
किसी भी entitlement को dashboard से खोलकर उसके grants देखें। Detail panel में कुल grants, status filter और प्रत्येक grant के लिए customer, access की तारीख, status और Revoke action वाली एक row दिखाई देती है।Grants को programmatically manage करने के लिए उन्हें status filter के साथ list करें और ID से किसी एक grant को revoke करें:
import DodoPayments from 'dodopayments';const client = new DodoPayments({ bearerToken: process.env['DODO_PAYMENTS_API_KEY'],});// List grants for an entitlementconst grants = await client.entitlements.grants.list('ent_abc123', { status: 'Delivered',});// Revoke a single grantawait client.entitlements.grants.revoke('entg_xyz789', { id: 'ent_abc123',});
Dodo Payments grant lifecycle के लिए चार webhook events भेजता है। प्रत्येक customer को किस चीज़ का access है, इसके साथ अपने application को sync में रखने के लिए इन्हें subscribe करें।
Event
कब सक्रिय होता है
entitlement_grant.created
Grant बनाए जाने पर। Auto-fulfilled license-key grants और feature-flag grants Delivered आते हैं। Manually fulfilled license-key grants और हर अन्य integration Pending आते हैं, फिर platform call सफल होने पर या OAuth-based integrations के लिए customer के authorize करने पर Delivered में बदल जाते हैं।
entitlement_grant.delivered
कोई existing grant Delivered में बदलता है, इसलिए customer को अब access मिल जाता है। Creation के समय Delivered रहने वाला grant केवल created fire करता है।
entitlement_grant.failed
Grant डिलीवर नहीं किया जा सका। error_code और error_message देखें।
entitlement_grant.revoked
Access वापस ले लिया गया है। revocation_reason देखें।
Entitlement Grant Webhook Payloads
पूरा payload schema, sample events और revocation_reason reference देखें।
हर delivery channel के लिए एक entitlement का उपयोग करें। अलग-अलग role intentions वाले products के बीच एक Discord entitlement share न करें। प्रत्येक role के लिए एक entitlement बनाएँ, ताकि revocation साफ़-सुथरा रहे।
पहले test mode में परीक्षण करें। Entitlement बनाएँ, उसे test product से attach करें, checkout चलाएँ और grant को Pending से Delivered में बदलते देखें। फिर test subscription cancel करें और पुष्टि करें कि grant revoke हो गया है।
entitlement_grant.delivered को listen करें, payment.succeeded को नहीं। Fulfillment पूरा होने से पहले payment सफल हो सकता है, खासकर OAuth flows के लिए। अपने systems में dependent features unlock करने से पहले grant के Delivered तक पहुँचने की प्रतीक्षा करें। Creation के समय डिलीवर होने वाला grant, जैसे auto-fulfilled license key या feature flag, इसके बजाय entitlement_grant.created के रूप में status: "Delivered" के साथ आता है।
entitlement_grant.failed को actionable मानें। Failed grant का अर्थ है कि customer ने भुगतान किया लेकिन उसे access नहीं मिला। इन grants को अपनी support team को दिखाएँ या re-grant trigger करें।
revocation_reason को अपने retention flows से map करें।subscription_on_hold revoke recoverable होता है, क्योंकि customer अपना card update कर सकता है। manual revoke intentional होता है। Customer messages में इनके साथ अलग-अलग व्यवहार करें।
subscription.past_due पर access revoke न करें। यह event एक grace period शुरू करता है और window समाप्त होने तक customer access बनाए रखता है। subscription.on_hold या subscription.cancelled की प्रतीक्षा करें।