License keys are the License Key entitlement type. Create a License Key entitlement once with the activation limit, expiry, and instructions you want, attach it to any product, and Dodo Payments generates and delivers a key per purchase or subscription seat, automatically.
What are License Keys?
License keys are unique tokens that authorize access to your product. They’re ideal for:- Software licensing: Desktop apps, plugins, and CLIs
- Per-seat controls: Limit activations per user or device
- Digital goods: Gate downloads, updates, or premium features
Create a License Key Entitlement
1
Open Entitlements
Go to Entitlements in your Dodo Payments dashboard and click + to create a new entitlement.
2
Choose License Key
Select License Key as the integration. Configure how each issued key behaves:
- Activations Limit: Maximum concurrent activations per key (e.g.,
1for single-user,5for team licenses, leave blank for unlimited). - Duration: How long the key stays valid after issuance (e.g., 30 days, 1 year). For subscription-issued keys, leave blank; keys remain valid as long as the subscription is active.
- Activation Instructions: Customer-facing instructions emailed with the key. Examples:
Paste the key in Settings → LicenseorRun: mycli activate <key>.

3
Save the entitlement
Save. The entitlement is now available to attach to any product.
Attach to Products
Open a product, expand Advanced Settings → Entitlements & Credits, and select your License Key entitlement. A single product can deliver a license key alongside other entitlements (Discord access, file downloads, GitHub repo access, etc.) on the same purchase.
How Keys Are Issued
Key issuance follows the standard grant lifecycle:Quantity behavior
- Subscription products issue one key per seat (
subscriptions.quantity). - One-time products issue one key per cart line item (
product_cart.quantity). - Manual API grants issue exactly one key.
Activation, Validation, Deactivation
The activation/validation/deactivation API endpoints are public and require no API key. Use them directly from desktop software, CLIs, or browser-based clients to verify keys at runtime.Public Endpoints: The activate, deactivate, and validate license endpoints are public and do not require an API key. Call them directly from your client applications without exposing your API credentials.
Activate a license
Validate a license
Deactivate an activation instance
Manage Keys
عند شراء العميل لمنتج بوضعية يدوية، يتم إنشاء المنحة بحالةpending بدون مفتاح ويتم تشغيل entitlement_grant.created webhook مع integration_type: "license_key" و status: "pending". يمكنك الاستجابة لهذا الـ webhook، أو الاستعلام عن نقطة النهاية List Customer Grants باستخدام الفلترين: integration_type و status:
Import Existing License Keys via API
Already have license keys in another system? Use the Create License Key API to import them into Dodo Payments. This lets you migrate existing keys without disrupting your customers — they continue to activate, validate, and deactivate against the same key strings without re-issuance.How imported keys differ from auto-generated keys
Use the
source field on GET /license_keys responses to distinguish migrated inventory from organically issued keys when reconciling or auditing.
License Keys in Return URL
When a customer completes a purchase for a product with a License Key entitlement, the generated key is automatically appended to yourreturn_url as a query parameter. This lets you display the key immediately on your success page without making an extra API call.
subscription_id is used instead of payment_id:
API Management
Lifecycle Operations (Public Endpoints)
Lifecycle Operations (Public Endpoints)
Activation, deactivation, and validation are public; no API key required.
Activate License
Create or record an activation instance for a license key.
Deactivate License
Revoke a prior activation to free up capacity.
Validate License
Check authenticity, status, and constraints before granting access.
License Key Management
License Key Management
Create, list, retrieve, and update individual license key records. Use these to import existing keys or fetch usage details.
Create License Key
Create a new license key or import an existing one.
Get License Key
Retrieve a specific key and its metadata.
Update License Key
Modify expiry, activation limits, or enable/disable a key.
Entitlement Management
Entitlement Management
Manage the License Key entitlement itself: its activation limit, duration, and instructions.
Create Entitlement
Create a License Key entitlement.
Update Entitlement
Update the entitlement’s configuration.
List Grants
List the keys issued for an entitlement.
Revoke Grant
Manually revoke a customer’s key.
Webhooks
License-key delivery and revocation fire the fourentitlement_grant.* webhook events. The grant payload includes a populated license_key object with the key, expiry, activations used, and limit.
The legacy license_key.* events (license_key.created) continue to fire for the underlying license-key record lifecycle; see the License Key webhook payload page.
Legacy License Keys
Products created with the older
license_key_enabled flag have been automatically migrated to a License Key entitlement. The migration is transparent: existing customers’ keys continue to work unchanged, the public /licenses/activate, /licenses/validate, /licenses/deactivate endpoints continue to function, and the /license_keys/* API endpoints continue to read and write to the same key store.The standalone License Keys dashboard section remains available as a flat list of every key issued, useful for audit and search. New configuration (changing activation limits, durations, or instructions) should be done by editing the migrated License Key entitlement under Entitlements.Best Practices
- Keep activation limits clear: Choose sensible defaults (1 for single-user apps, 3–5 for team licenses) and document them.
- Provide precise activation instructions: Customers paste these from their email, so exact paths and commands save support tickets.
- Validate keys server-side: For network-connected products, validate via
/licenses/validaterather than caching activation locally. - Use webhooks for revocation: Listen to
entitlement_grant.revokedto disable in-app features immediately when a customer cancels or refunds. - Test with subscriptions and one-times: License key behavior differs subtly between the two, so test both before going live.
إدارة API
Lifecycle Operations (Public Endpoints)
Lifecycle Operations (Public Endpoints)
التفعيل، الإلغاء، والتحقق علني؛ لا يتطلب مفتاح API.
Activate License
أنشئ أو سجل مثيل تنشيط لمفتاح الترخيص.
Deactivate License
قم بإلغاء التنشيط السابق لتحرير السعة.
Validate License
تحقق من الأصالة، الحالة، والقيود قبل منح الوصول.
License Key Management
License Key Management
أنشئ، اعرض، استرجع، وقم بتحديث سجلات مفاتيح الترخيص الفردية. استخدمها لاستيراد المفاتيح الحالية أو لجلب تفاصيل الاستخدام.
Create License Key
أنشئ مفتاح ترخيص جديد أو قم باستيراد مفتاح موجود.
List License Keys
تصفح جميع المفاتيح بحالة الاستخدام وتفاصيلها.
Get License Key
استرجع مفتاحًا محددًا وبيانات التعريف الخاصة به.
Update License Key
قم بتعديل انتهاء الصلاحية، حدود التفعيل، أو تفعيل/تعطيل مفتاح.
Entitlement Management
Entitlement Management
قم بإدارة استحقاق مفتاح الترخيص نفسه: حده على التفعيل، مدته، وتعليماته.
Create Entitlement
أنشئ استحقاق مفتاح ترخيص.
Update Entitlement
قم بتحديث تكوين الاعتماد.
List Grants
اعرض المفاتيح الصادرة لاستحقاق.
Revoke Grant
قم بإلغاء مفتاح العميل يدويًا.
Webhooks
تفعيل وإلغاء تفعيل مفتاح الترخيص يُشعل الأحداث الأربعentitlement_grant.* webhook. تشمل حمولة المنحة كائنًا معبأً license_key بالمفتاح، والانتهاء، والتفعيلات المستخدمة، والحد.
تستمر أحداث license_key.* القديمة (license_key.created) في العمل لدورة حياة سجل مفتاح الترخيص الأساسي؛ يتم الاطلاع على صفحة حمولة مفتاح الترخيص webhook.
مفاتيح الترخيص القديمة
تم ترحيل المنتجات التي تم إنشاؤها بالعلم القديم
license_key_enabled تلقائيًا إلى استحقاق مفتاح ترخيص. الترحيل شفاف: تواصل مفاتيح العملاء الحالية العمل بدون تغيير، وتستمر واجهات /licenses/activate العامة، /licenses/validate، و /licenses/deactivate في العمل، وتستمر نُقَطَةْ النهاية API الخاصة بـ /license_keys/* في القراءة والكتابة في نفس مجموعة المفاتيح.يظل قسم لوحة التحكم المستقلة مفاتيح الترخيص متاحًا كقائمة مستوية لكل مفتاح صادر، وهو مفيد للمراجعة والبحث. يجب أن يتم التكوين الجديد (تغيير حدود التنشيط أو المدد أو التعليمات) عن طريق تعديل استحقاق مفتاح الترخيص المرحل تحت استحقاقات.أفضل الممارسات
- اجعل حدود التنشيط واضحة: اختر افتراضات منطقية (1 لتطبيقات المستخدم الفردي، 3-5 لرخص الفريق) ووثقها.
- قدم تعليمات تنشيط دقيقة: يقوم العملاء بلصق هذه التعليمات من بريدهم الإلكتروني، لذا يوفر المسارات والأوامر الدقيقة تذاكر الدعم.
- تحقق من المفاتيح على الخادم: بالنسبة للمنتجات المتصلة بالشبكة، تحقق عبر
/licenses/validateبدلاً من تخزين التنشيط محليًا. - استخدم الـ webhooks للإلغاء: استمع إلى
entitlement_grant.revokedلتعطيل ميزات التطبيق فورًا عند إلغاء العميل أو رد المبلغ. - اختبر مع الاشتراكات والدفعات الواحدة: يختلف سلوك مفتاح الترخيص بدقة بين الاثنين، لذا قم باختبار كليهما قبل الدخول في التشغيل الفعلي.