Skip to main content
License keys, License Key entitlement type हैं। Activation limit, expiry और अपनी इच्छित activation message के साथ एक License Key entitlement बनाएं, फिर उसे किसी भी product से जोड़ें। डिफ़ॉल्ट रूप से, Dodo Payments खरीदी गई प्रत्येक unit या subscription seat के लिए एक key generate और email करता है।

License Keys क्या हैं?

License key एक unique token है जो आपके product तक access अधिकृत करता है। License keys का उपयोग इन चीज़ों के लिए करें:
  • Software licensing: desktop apps, plugins और CLIs।
  • Per-seat controls: प्रत्येक user या device के लिए activations सीमित करें।
  • Digital goods: downloads, updates या premium features तक access नियंत्रित करें।
Dodo Payments Entitlements के माध्यम से license keys manage करता है। आपके अन्य entitlements को संचालित करने वाले payment और subscription events ही प्रत्येक key के lifecycle—creation, expiry, revocation और re-grant—को संचालित करते हैं।

Create a License Key Entitlement

1

Open Entitlements

Dashboard में Entitlements पर जाएं और entitlement बनाने के लिए + पर click करें।
2

Choose License Key

License Keys चुनें, Name दर्ज करें और प्रत्येक जारी की गई key के व्यवहार को configure करें:
  • Fulfillment Mode: Automatic (डिफ़ॉल्ट) प्रत्येक key को generate और email करता है। Manual में आप प्रत्येक key स्वयं provide करते हैं। Manual Fulfillment देखें।
  • Activations Limit: प्रत्येक key के लिए active activations की अधिकतम संख्या, उदाहरण के लिए एक user के लिए 1 या team license के लिए 5। कोई limit न रखने के लिए Unlimited चुनें।
  • License Length: जारी होने के बाद key कितने समय तक valid रहती है, जैसे 30 days या 1 year, अथवा No expiration। Subscription products के लिए No expiration चुनें: subscription के लिए जारी keys expire नहीं होतीं और उनकी validity subscription status का अनुसरण करती है।
  • Activation Message: customer को दिखाई देने वाले optional instructions, अधिकतम 2,500 characters, जो key deliver करने वाले email में शामिल होते हैं। उदाहरण: Paste the key in Settings → License या Run: mycli activate <key>।
New License Key entitlement form with name, fulfillment mode, license length, activations limit, and activation message
3

Save the Entitlement

Create Entitlement पर click करें। अब आप entitlement को किसी भी product से जोड़ सकते हैं।

Attach to Products

किसी product को खोलें, उसके Entitlements section में जाएं और अपना License Key entitlement चुनें। एक product उसी purchase पर अन्य entitlements, जैसे Discord access, file downloads या GitHub repository access, के साथ license key deliver कर सकता है।
Product entitlements panel with License Key selected

Selecting the License Key entitlement in the product entitlements panel.


How Keys Are Issued

Key issuance standard grant lifecycle का अनुसरण करता है। प्रत्येक event license keys को इस प्रकार प्रभावित करता है:

Quantity Behavior

Keys की संख्या इस बात पर निर्भर करती है कि grant कहां से आता है। प्रत्येक key को अपना grant मिलता है।
  • Subscription products प्रति seat एक key जारी करते हैं (subscriptions.quantity)।
  • One-time products cart line item की प्रत्येक unit के लिए एक key जारी करते हैं (product_cart.quantity)।
  • Manual API grants ठीक एक key जारी करते हैं।

Fulfillment Mode

प्रत्येक License Key entitlement में एक fulfillment_mode होता है, जो यह नियंत्रित करता है कि key कौन provide करता है:
  • auto (डिफ़ॉल्ट, dashboard में Automatic): Dodo Payments payment या subscription पर key generate और email करता है। ऊपर दी गई table में यही behavior है और यह तब लागू होता है जब fulfillment_mode omit किया गया हो।
  • manual (dashboard में Manual): खरीदी गई प्रत्येक unit एक Pending grant बनाती है जिसमें कोई key नहीं होती और आप प्रत्येक key value provide करते हैं। Manual Fulfillment देखें।

Manual Fulfillment

Manual fulfillment में Dodo Payments द्वारा key generate करने के बजाय आप प्रत्येक license key provide करते हैं। Purchase बिना key के Pending grant बनाती है, webhook के माध्यम से आपको notify करती है और आपके key value submit करने की प्रतीक्षा करती है। इसका उपयोग तब करें जब keys आपके अपने system, किसी third-party vendor या पहले से print किए गए codes के सीमित pool से आती हों।
Product creation से key delivery तक step-by-step build के लिए Manual License Key Fulfillment Integration Guide देखें।

इसका उपयोग कब करें

Automatic fulfillment अधिकांश software licensing के लिए उपयुक्त है। जब Dodo Payments स्वयं key generate न कर सके, तब manual fulfillment चुनें:
  • Bring your own keys: आपका application, desktop product या अपना license server key generate करता है।
  • Third-party vendors: आप upstream provider द्वारा जारी keys को resell करते हैं, जैसे game key, API credential या partner platform license।
  • Finite inventory: आप पहले से allocate किए गए pool से codes एक-एक करके वितरित करते हैं।
  • Human review: access जारी करने से पहले आप purchase की जांच करना चाहते हैं।

Manual Fulfillment Enable करें

API के माध्यम से manual fulfillment enable करने के लिए License Key entitlement के integration_config में fulfillment_mode: "manual" set करें। Dashboard में Fulfillment Mode को Manual पर set करें।
fulfillment_mode backward compatible है। इस setting के मौजूद होने से पहले बनाए गए entitlements में fulfillment_mode नहीं होता और वे auto के रूप में व्यवहार करते हैं। manual पर switch करने से केवल बदलाव के बाद बनाए गए grants प्रभावित होते हैं। पहले से deliver की गई keys में कोई बदलाव नहीं होता।

Fulfillment की प्रतीक्षा कर रहे Grants खोजें

जब कोई customer manual-mode entitlement वाला product खरीदता है, तो Dodo Payments बिना key के grant को Pending status में बनाता है और integration_type: "license_key" तथा status: "Pending" के साथ एक entitlement_grant.created webhook भेजता है। उस webhook पर प्रतिक्रिया दें या integration_type और status filters के साथ List Customer Grants endpoint को poll करें:

Key Deliver करें

Key deliver करने के लिए उसे Fulfill License Key Grant endpoint पर भेजें। Grant Delivered में चला जाता है और Dodo Payments customer को key email करता है। यह वही email है जो automatic fulfillment के अंतर्गत customer को मिलता है।
cURL
activations_limit और expires_at optional हैं। इन्हें omit करने पर Dodo Payments entitlement का configuration उपयोग करता है। प्रत्येक grant को केवल एक बार fulfill किया जा सकता है: पहले से fulfilled grant को दोबारा retry करने पर दूसरी key जारी करने के बजाय 409 लौटता है।
आपको key स्वयं email करने की आवश्यकता नहीं है। Grant fulfill होने पर Dodo Payments इसे deliver करता है। POST /license_keys के साथ Importing keys अलग तरीके से काम करता है: यह customer को notify नहीं करता।

Activation, Validation, Deactivation

आपका software runtime पर तीन endpoints के माध्यम से key manage करता है। Activation किसी device या installation को key के विरुद्ध record करता है, validation जांचता है कि key usable है या नहीं और deactivation किसी activation को free करता है।
Public Endpoints: activate, deactivate और validate license endpoints public हैं और इनके लिए API key आवश्यक नहीं है। अपने API credentials expose किए बिना इन्हें desktop software, CLIs या browser-based clients से सीधे call करें। SDK constructors में अब भी bearer token value आवश्यक है, इसलिए SDK examples में placeholder pass किया गया है।

License Activate करें

Activation key के लिए एक activation instance बनाता है और उसे lki_ ID के साथ लौटाता है। इस ID को store करें, क्योंकि instance deactivate करने के लिए इसकी आवश्यकता होगी। यदि key active नहीं है तो request 403, key मौजूद नहीं है तो 404 और key अपनी activation limit तक पहुंच गई है तो 422 लौटाती है।

License Validate करें

जब key का status active हो और key expire न हुई हो, तब validation valid: true लौटाता है। यह जांचने के लिए कि कोई specific activation instance अभी भी मौजूद है, उसका license_key_instance_id pass करें।

Activation Instance Deactivate करें

Deactivation activation instance को remove करता है और key पर एक activation free करता है। वह key और instance ID pass करें जो activation ने लौटाई थी। यदि instance key से संबंधित नहीं है तो request 403 और key मौजूद नहीं है तो 404 लौटाती है।

Keys Manage करें

जारी की गई keys देखने के लिए Entitlements के अंतर्गत License Key entitlement खोलें। Grants list प्रत्येक customer key के लिए एक row दिखाती है, जिसमें customer, access की date, status और Revoke action होता है। Key की expiry, activation count और activation limit देखने के लिए उसे Sales → License Keys के अंतर्गत खोलें। Grants को programmatically list करने के लिए List Grants call करें। प्रत्येक license-key grant में license_key object key, status, expiry, used activations और activation limit रखता है। अभी Pending स्थिति में मौजूद manual-mode grant पर यह object null होता है।

API के माध्यम से मौजूदा License Keys Import करें

किसी अन्य system से license keys migrate करने के लिए उन्हें Create License Key API से import करें। आपके customers उन्हीं key strings को activate, validate और deactivate करते रहेंगे, इसलिए आपको keys फिर से जारी करने की आवश्यकता नहीं है।
API के माध्यम से बनाई या update की गई license keys customers को email notifications trigger नहीं करतीं। Imported key के बारे में customers को बताने के लिए अपने application से notify करें।
Request में key, customer_id और product_id आवश्यक हैं। Unlimited activations के लिए activations_limit omit करें और कभी expire न होने वाली key के लिए expires_at omit करें। पहले से मौजूद key string import करने पर 409 लौटता है।

Source के अनुसार Keys में अंतर

source field यह record करता है कि प्रत्येक license key कैसे बनाई गई थी: Migrated और manually fulfilled keys को Dodo Payments द्वारा generated keys से अलग पहचानने के लिए source का उपयोग करें, उदाहरण के लिए keys को reconcile या audit करते समय। यह field license key records पर होता है, जैसे POST /license_keys response। List Grants से प्राप्त grants का license_key object इसे शामिल नहीं करता। Legacy GET /license_keys endpoint, जो source लौटाता है और source filter स्वीकार करता है, deprecated है।
Polar.sh या Lemon Squeezy से migrate कर रहे हैं? dodo-migrate CLI एक single command से products, customers, discounts और license keys को bulk में import करता है और external IDs को Dodo Payments IDs से map करता है।

Return URL में License Keys

जब कोई customer License Key entitlement वाला product खरीदता है, तो Dodo Payments generated key को आपके return_url में license_key query parameter के रूप में append करता है। आपका success page अतिरिक्त API call के बिना key दिखा सकता है:
यदि purchase से एक से अधिक keys generate होती हैं (quantity 1 से अधिक), तो parameter में comma-separated list होती है। Comma को URL में %2C के रूप में encode किया जाता है, इसलिए split करने से पहले parameter को URL parser से पढ़ें, जो इसे decode कर देता है:
Subscriptions के लिए URL में payment_id के बजाय subscription_id और subscription status होता है:
Purchase के तुरंत बाद key दिखाने के लिए अपने return page पर license_key parameter पढ़ें।

API Management

Activation, deactivation और validation public हैं और इनके लिए API key आवश्यक नहीं है।

Activate License

License key के लिए activation instance बनाएं।

Deactivate License

Capacity free करने के लिए activation instance remove करें।

Validate License

Access grant करने से पहले जांचें कि key active और unexpired है।
Individual license key records को create, list, retrieve और update करें। Existing keys import करने या usage details पढ़ने के लिए इन endpoints का उपयोग करें।
GET /license_keys, GET /license_keys/{id} और PATCH /license_keys/{id} deprecated हैं। Reads के लिए entitlement grant endpoints (List Grants, List Customer Grants) का उपयोग करें। Existing keys import करने के लिए POST /license_keys अब भी supported है।

Create License Key

License key बनाएं या मौजूदा key import करें।

List License Keys

Status और usage details के साथ सभी keys browse करें।

Get License Key

किसी specific key और उसके metadata को retrieve करें।

Update License Key

Expiry या activation limit बदलें अथवा key को enable या disable करें।
License Key entitlement को स्वयं manage करें: इसकी activation limit, license length और activation message।

Create Entitlement

License Key entitlement बनाएं।

Update Entitlement

Entitlement का configuration update करें।

List Grants

किसी entitlement के लिए जारी की गई keys list करें।

Revoke Grant

Customer की key manually revoke करें।

Webhooks

License key delivery और revocation चार entitlement_grant.* webhook events भेजते हैं। License-key grants के लिए payload में key, status, expiry, used activations और activation limit वाला license_key object शामिल होता है। Legacy license_key.created event license key record बनने पर अब भी fire होता है। License Key webhook payload page देखें।
नई integrations के लिए license_key.created के बजाय entitlement grant events handle करें। Auto-fulfilled key entitlement_grant.created के रूप में status: "Delivered" के साथ आती है और इसके बाद कोई अलग entitlement_grant.delivered event नहीं आता। Manually fulfilled key तब entitlement_grant.delivered fire करती है जब आप उसे provide करते हैं। यही events product के प्रत्येक entitlement को cover करते हैं, केवल license key को नहीं।

Legacy License Keys

पुराने license_key_enabled flag के साथ बनाए गए products को automatically migrated करके License Key entitlement में बदल दिया गया है। Migration transparent है: मौजूदा customers की keys काम करती रहती हैं, public /licenses/activate, /licenses/validate और /licenses/deactivate endpoints काम करते रहते हैं और /license_keys/* API endpoints उसी key store को read और write करते हैं।Standalone Sales → License Keys dashboard section audit और search के लिए जारी की गई प्रत्येक key की flat list के रूप में उपलब्ध रहती है। Activation limits, license length या activation message बदलने के लिए migrated License Key entitlement को Entitlements के अंतर्गत edit करें।

Best Practices

  • Clear activation limits चुनें: single-user apps के लिए 1 या team licenses के लिए 3–5 जैसे defaults चुनें और उन्हें अपने customers के लिए document करें।
  • Precise activation messages लिखें: Customers इन्हें license key email से copy करते हैं, इसलिए exact paths और commands support tickets को रोकते हैं।
  • API के विरुद्ध keys validate करें: network-connected products के लिए locally cached activation पर निर्भर रहने के बजाय /licenses/validate call करें।
  • Revocation के लिए webhooks का उपयोग करें: जब customer cancel करे या refund प्राप्त करे, तो in-app features disable करने के लिए entitlement_grant.revoked handle करें।
  • Subscriptions और one-time purchases test करें: दोनों के बीच license key behavior अलग होता है; उदाहरण के लिए subscription keys expire नहीं होतीं, इसलिए live होने से पहले दोनों को test करें।
अंतिम संशोधन 26 सितंबर 2026