Skip to main content
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
Inside Dodo Payments, license keys are managed through the Entitlements system, meaning the lifecycle of every key (creation, expiry, revocation, regrant) is driven by the same payment and subscription events as your other deliverables.

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., 1 for single-user, 5 for 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 → License or Run: mycli activate <key>.
New License Key entitlement form with name, fulfillment mode, license length, activations limit, and activation message
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.
Product entitlements panel with License Key selected

Selecting the License Key entitlement in the product entitlements panel.


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.

Fulfillment mode

Every License Key entitlement has a fulfillment_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 when fulfillment_mode is omitted.
  • manual: The purchase creates a Pending grant 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 a Pending 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

Set fulfillment_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 in Pending 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 Customer 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 to Delivered 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.
License keys created or updated through the API do not trigger email notifications to customers. If you need to notify customers about an imported key, handle that separately in your application.

How keys differ by source

在核对或审计时,使用 license-key 记录上的 source 字段,将迁移的库存和手动履行的密钥与正常签发的密钥区分开来。从 List Grants 返回的授予中的 license_key 对象读取该字段;旧版 GET /license_keys endpoint 已弃用。
Migrating from Polar.sh or Lemon Squeezy? The dodo-migrate CLI automates bulk imports of products, customers, discounts, and license keys in a single command and maps external IDs to Dodo IDs automatically.

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 your return_url as a query parameter. This lets you display the key immediately on your success page without making an extra API call.
If the purchase generates multiple keys (quantity > 1), they are comma-separated:
For subscriptions, subscription_id is used instead of payment_id:
Parse the license_key parameter on your return page to show the key immediately, improving the post-purchase experience.

API Management

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.
Create, list, retrieve, and update individual license key records. Use these to import existing keys or fetch usage details.
GET /license_keysGET /license_keys/{id}PATCH /license_keys/{id} 已弃用。读取数据请使用 entitlement grant endpoints(List GrantsList Customer Grants)。POST /license_keys 仍受支持,可用于导入现有密钥。

Create License Key

创建新的 License Key 或导入现有密钥。

List License Keys

浏览所有密钥及其状态和使用详情。

Get License Key

获取特定密钥及其元数据。

Update License Key

修改过期时间、激活限制,或启用/禁用密钥。
管理 License Key entitlement 本身:其激活限制、时长和说明。

Create Entitlement

创建 License Key entitlement。

Update Entitlement

更新 entitlement 的配置。

List Grants

列出为某个 entitlement 签发的密钥。

Revoke Grant

手动撤销客户的密钥。

Webhooks

License Key 的交付和撤销会触发四个 entitlement_grant.* webhook events。授予 payload 包含已填充的 license_key 对象,其中包含密钥、过期时间、已使用的激活次数和限制。 旧版 license_key.* events(license_key.created)仍会针对底层 license-key 记录生命周期触发;请参阅 License Key webhook payload page
对于新的集成,请监听 entitlement_grant.delivered,而不是 license_key.created。entitlement event 会告知你产品上的所有集成均已完成交付,而不仅仅是 License Key。

旧版 License Keys

使用旧版 license_key_enabled flag 创建的产品,已自动迁移到 License Key entitlement。迁移过程是透明的:现有客户的密钥继续保持不变并正常工作,公开的 /licenses/activate/licenses/validate/licenses/deactivate endpoints 继续运行,/license_keys/* API endpoints 也继续读写同一个密钥存储。独立的 License Keys dashboard section 仍然可用,其中以平面列表形式显示所有已签发的密钥,便于审计和搜索。新的配置(更改激活限制、时长或说明)应通过在 Entitlements 下编辑迁移后的 License Key entitlement 来完成。

最佳实践

  • 明确激活限制:选择合理的默认值(单用户应用为 1,团队许可证为 3–5),并记录这些限制。
  • 提供精确的激活说明:客户会从电子邮件中复制这些内容,因此提供准确的路径和命令可以减少支持工单。
  • 在服务器端验证密钥:对于联网产品,应通过 /licenses/validate 进行验证,而不是在本地缓存激活状态。
  • 使用 Webhooks 处理撤销:监听 entitlement_grant.revoked,以便客户取消或退款时立即禁用应用内功能。
  • 同时测试订阅和一次性购买:两者的 License Key 行为存在细微差异,因此上线前应分别进行测试。
最后修改于 2026年8月21日