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
Open Entitlements
Go to Entitlements in your Dodo Payments dashboard and click + to create a new entitlement.
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>.

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:| Event | Behavior |
|---|---|
payment.succeeded (one-time) | Generate one key per quantity purchased. Key expiry honors the entitlement’s duration. |
subscription.active | Generate one key per subscription quantity (seat). Key has no expiry; validity is tied to subscription status. |
subscription.renewed | No-op. Existing keys persist. |
subscription.on_hold | Disable the keys. They reactivate when the subscription comes off hold. |
subscription.cancelled / expired | Disable the keys permanently. |
subscription.plan_changed | Disable the old keys; issue new ones for the new plan. |
refund.succeeded (one-time) | Disable the keys. |
| Manual revoke via API/dashboard | Disable the keys with revocation_reason: manual. These are not auto-regranted on subscription renewal. |
| License key disabled directly | Revoke the grant with revocation_reason: license_key_disabled. Re-enabling the key re-activates the grant automatically. |
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.
Fulfillment mode
Every License Key entitlement has afulfillment_mode that controls who supplies the key:
auto(default): Dodo Payments generates and emails the key automatically on payment or subscription. This is the behavior described above and applies whenfulfillment_modeis omitted.manual: The purchase creates apendinggrant with no key, and you supply each key value yourself. See Manual Fulfillment below.
Manual Fulfillment
By default, Dodo Payments generates and emails a license key the moment a customer pays. With manual fulfillment you supply the key yourself: the purchase creates apending grant with no key, notifies you, and waits for you to submit the key value. Use it when keys come from your own system, a third-party vendor, or a finite pool of pre-printed codes.
Looking for a step-by-step build? See the Manual License Key Fulfillment Integration Guide for an end-to-end walkthrough from product creation to delivering the key.
When to use it
Auto fulfillment is the right default for most software licensing. Choose manual fulfillment when Dodo Payments cannot mint the key itself:- Bring-your-own-keys: The key is generated by your application, a desktop product, or your own license server.
- Third-party vendors: You resell keys issued by an upstream provider (a game key, an API credential, a partner platform).
- Finite inventory: You hand out codes from a pre-allocated pool and want to assign them one at a time.
- Human review: You want to vet a purchase before releasing access.
Enable manual fulfillment
Setfulfillment_mode: "manual" on the License Key entitlement’s integration config:
fulfillment_mode is backward compatible. Entitlements created before this setting existed have no fulfillment_mode and continue to behave as auto. Switching to manual only affects grants created after the change; keys already delivered are untouched.Find grants awaiting fulfillment
When a customer buys a manual-mode product, the grant is created inpending status with no key and an entitlement_grant.created webhook fires with integration_type: "license_key" and status: "pending". You can react to that webhook, or poll the List Grants endpoint with the integration_type and status filters:
Deliver the key
Submit the key with the Fulfill License Key Grant endpoint. The grant moves todelivered and the customer is sent the key automatically — the same email they would receive under auto fulfillment.
cURL
activations_limit and expires_at are optional and fall back to the entitlement config when omitted. Each grant can be fulfilled once; retrying an already-fulfilled grant returns 409 rather than issuing a second key.
You do not need to email the key yourself — delivery happens automatically when the grant is fulfilled. This differs from importing keys via
POST /license_keys, which intentionally does not notify the customer.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
Open the License Key entitlement from your dashboard to see every grant (one row per customer key) with delivery date, activation count, and a revoke action. Each grant detail surfaces the underlying license key, expiry, activations used, and the activations limit. You can also list grants programmatically: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 keys differ by source
| Field | Auto-generated key | Manually fulfilled key | Imported key |
|---|---|---|---|
source | "auto" | "manual" | "import" |
| Origin | Generated by Dodo Payments on payment | Supplied by you against a pending grant | Created/migrated via POST /license_keys |
payment_id | Set to the originating payment | Resolved from the grant or its subscription | null (no Dodo Payments transaction) |
subscription_id | Set if issued via a subscription | Set if the grant came from a subscription | null unless explicitly linked |
| Customer email notification | Sent on issuance | Sent on fulfillment | Not sent — handle separately |
source field on GET /license_keys responses to distinguish migrated inventory and manually fulfilled keys 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.
List License Keys
Browse all keys with status and usage details.
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.