Skip to main content
License keysはLicense Key entitlement typeです。必要な有効化制限、有効期限、手順を設定してLicense Key entitlementを一度作成し、任意のproductに紐付けます。Dodo Paymentsが、購入またはsubscription seatごとにkeyを自動生成して配信します。

License Keysとは?

License keysは、productへのアクセスを許可する一意のtokenです。次の用途に適しています。
  • ソフトウェアライセンス: Desktop apps、plugins、CLIs
  • seat単位の制御: userまたはdeviceごとのactivationを制限
  • デジタル商品: downloads、updates、premium featuresへのアクセスを制御
Dodo Paymentsでは、license keysはEntitlements systemで管理されます。つまり、各keyのlifecycle(creation、expiry、revocation、regrant)は、他のdeliverablesと同じpaymentおよびsubscription eventsによって制御されます。

License Key Entitlementを作成する

1

Open Entitlements

Dodo Payments dashboardでEntitlementsに移動し、**+**をクリックして新しいentitlementを作成します。
2

Choose License Key

integrationとしてLicense Keyを選択します。発行される各keyの動作を設定します。
  • Activations Limit: keyごとの同時activationの最大数(例: 1ユーザーの場合は1、team licensesの場合は5、無制限の場合は空欄)。
  • Duration: 発行後にkeyが有効である期間(例: 30日、1年)。subscription-issued keysでは空欄にします。subscriptionがactiveである限り、keysは有効です。
  • Activation Instructions: keyとともにemailで送信される、customer向けの手順。例: Paste the key in Settings → LicenseまたはRun: mycli activate <key>
名前、fulfillment mode、license length、activations limit、activation messageを含む新しいLicense Key entitlementフォーム
3

Save the entitlement

保存します。entitlementを任意のproductに紐付けられるようになりました。

Productsに紐付ける

productを開き、Advanced Settings → Entitlements & Creditsを展開して、License Key entitlementを選択します。1つのproductで、同じ購入に対して他のentitlements(Discord access、file downloads、GitHub repo accessなど)とともにlicense keyを配信できます。
License Keyが選択されたproduct entitlementsパネル

Selecting the License Key entitlement in the product entitlements panel.


Keysの発行方法

Keyの発行は標準のgrant lifecycleに従います。

Quantityの動作

  • Subscription productsはseatごとに1つのkeyを発行します(subscriptions.quantity)。
  • One-time productsはcart line itemごとに1つのkeyを発行します(product_cart.quantity)。
  • Manual API grantsは正確に1つのkeyを発行します。

Fulfillment mode

すべてのLicense Key entitlementには、keyを誰が提供するかを制御するfulfillment_modeがあります。
  • auto(default): Dodo Paymentsが、paymentまたはsubscription時にkeyを自動生成してemailで送信します。これは上記の動作で、fulfillment_modeが省略された場合に適用されます。
  • manual: 購入によってkeyのないpending grantが作成され、各key valueは自分で提供します。以下のManual Fulfillmentを参照してください。

Manual Fulfillment

defaultでは、customerが支払った直後にDodo Paymentsがlicense keyを生成してemailで送信します。manual fulfillmentでは、自分でkeyを提供します。購入によってkeyのないpending grantが作成され、通知を受けた後、key valueの送信を待機します。keysが自社system、third-party vendor、または事前印刷されたcodeの有限poolから提供される場合に使用します。
step-by-stepの構築方法を確認しますか?productの作成からkeyの配信までの一連の手順については、Manual License Key Fulfillment Integration Guideを参照してください。

使用するタイミング

ほとんどのソフトウェアライセンスでは、auto fulfillmentが適切なdefaultです。Dodo Payments自体でkeyをmintできない場合は、manual fulfillmentを選択します。
  • Bring-your-own-keys: keyはapplication、desktop product、または自社のlicense serverによって生成されます。
  • Third-party vendors: upstream providerが発行したkeys(game key、API credential、partner platform)を再販売します。
  • Finite inventory: 事前に割り当てたpoolからcodeを1つずつ配布します。
  • Human review: accessを提供する前に購入を審査します。

Manual fulfillmentを有効にする

License Key entitlementのintegration configでfulfillment_mode: "manual"を設定します。
fulfillment_modeはbackward compatibleです。このsettingが存在する前に作成されたentitlementsにはfulfillment_modeがなく、autoとして動作し続けます。manualへの切り替えは、変更後に作成されたgrantにのみ影響します。すでに配信されたkeysは変更されません。

Fulfillment待ちのgrantsを見つける

customerがmanual-mode productを購入すると、grantはkeyのないpending statusで作成され、entitlement_grant.created webhookがintegration_type: "license_key"status: "pending"を含めて発火します。このwebhookに応答するか、integration_typeおよびstatus filtersを使用してList Customer Grants endpointをpollできます。

Keyを配信する

Fulfill License Key Grant endpointでkeyを送信します。grantはdeliveredになり、customerにはkeyが自動的に送信されます。auto fulfillmentの場合と同じemailです。
cURL
activations_limitexpires_atは任意で、省略時はentitlement configにフォールバックします。各grantは1回のみfulfillできます。すでにfulfilledのgrantを再試行すると、2つ目のkeyを発行せず409を返します。
keyを自分でemail送信する必要はありません。grantがfulfilledになると自動的に配信されます。これはPOST /license_keys経由でimporting keysする場合とは異なり、後者では意図的にcustomerへ通知されません。

Activation、Validation、Deactivation

activation/validation/deactivation API endpointsはpublicで、API keyを必要としません。desktop software、CLIs、またはbrowser-based clientsから直接使用して、runtimeでkeysを検証します。
Public Endpoints: activate、deactivate、validate license endpointsはpublicで、API keyを必要としません。API credentialsを公開せず、client applicationsから直接呼び出してください。

Licenseをactivateする

Licenseをvalidateする

Activation instanceをdeactivateする


Keysを管理する

dashboardからLicense Key entitlementを開くと、delivery date、activation count、revoke actionとともに、すべてのgrant(customer keyごとに1行)を確認できます。各grant detailには、基盤となるlicense key、expiry、使用済みactivations、activations limitが表示されます。 grantsをprogrammaticallyにlistすることもできます。

API経由で既存のLicense Keysをimportする

すでに別のsystemにlicense keysがありますか?Create License Key APIを使用して、Dodo Paymentsにimportします。これによりcustomerに影響を与えず既存keysを移行できます。再発行することなく、同じkey stringsに対して引き続きactivate、validate、deactivateできます。
API経由で作成または更新されたlicense keysは、customerへのemail notificationsを発生させません。importしたkeyについてcustomerに通知する必要がある場合は、applicationで別途処理してください。

Sourceによるkeysの違い

GET /license_keys responsesのsource fieldを使用して、reconcilingまたはauditingの際に、migrated inventoryとmanually fulfilled keysをorganically issued keysと区別します。
Polar.shまたはLemon Squeezyから移行しますか?dodo-migrate CLIは、products、customers、discounts、license keysのbulk importsを1つのcommandで自動化し、external IDsをDodo IDsに自動的にmapします。

Return URLのLicense Keys

customerがLicense Key entitlementを含むproductの購入を完了すると、生成されたkeyが自動的にreturn_urlにquery parameterとして追加されます。これにより、追加のAPI callなしでsuccess pageにkeyをすぐ表示できます。
購入によって複数のkeys(quantity > 1)が生成される場合、comma-separatedになります。
subscriptionsでは、payment_idの代わりにsubscription_idが使用されます。
return pageでlicense_key parameterをparseしてkeyをすぐ表示すると、購入後のexperienceが向上します。

API Management

Activation、deactivation、validationはpublicです。API keyは必要ありません。

Activate License

license keyのactivation instanceを作成または記録します。

Deactivate License

以前のactivationをrevokeしてcapacityを解放します。

Validate License

accessを許可する前にauthenticity、status、constraintsを確認します。
個別のlicense key recordsをcreate、list、retrieve、updateします。既存keysのimportやusage detailsの取得に使用します。

Create License Key

新しいlicense keyを作成するか、既存のものをimportします。

List License Keys

statusとusage detailsを含むすべてのkeysを参照します。

Get License Key

specificなkeyとそのmetadataを取得します。

Update License Key

expiry、activation limits、keyのenable/disableを変更します。
License Key entitlement自体(activation limit、duration、instructions)を管理します。

Create Entitlement

License Key entitlementを作成します。

Update Entitlement

entitlementのconfigurationを更新します。

List Grants

entitlementに対して発行されたkeysをlistします。

Revoke Grant

customerのkeyを手動でrevokeします。

Webhooks

License-key deliveryとrevocationでは、4つのentitlement_grant.* webhook eventsが発火します。grant payloadには、key、expiry、使用済みactivations、limitが設定されたlicense_key objectが含まれます。 legacyのlicense_key.* events(license_key.created)は、基盤となるlicense-key record lifecycleに対して引き続き発火します。License Key webhook payload pageを参照してください。
新しいintegrationsでは、license_key.createdではなくentitlement_grant.deliveredをlistenしてください。entitlement eventは、license keyだけでなくproduct上のすべてのintegrationsでdeliveryが完了したことを示します。

Legacy License Keys

古いlicense_key_enabled flagを使用して作成されたproductsは、License Key entitlementへ自動的に移行されています。移行は透過的です。既存customerのkeysは変更なく引き続き動作し、publicの/licenses/activate/licenses/validate/licenses/deactivate endpointsも引き続き機能します。また、/license_keys/* API endpointsは同じkey storeに対してread/writeを続けます。standaloneのLicense Keys dashboard sectionは、発行されたすべてのkeysのflat listとして引き続き利用できます。auditやsearchに便利です。新しいconfiguration(activation limits、durations、instructionsの変更)は、Entitlementsで移行済みのLicense Key entitlementを編集して行ってください。

Best Practices

  • activation limitsを明確にする: 適切なdefault(single-user appsでは1、team licensesでは3–5)を選び、documentします。
  • 正確なactivation instructionsを提供する: customerはemailからこれらをcopy and pasteするため、正確なpathsとcommandsによってsupport ticketsを減らせます。
  • server-sideでkeysをvalidateする: network-connected productsでは、activationをlocalにcacheするのではなく/licenses/validate経由でvalidateします。
  • revocationにはwebhooksを使用する: customerがcancelまたはrefundした際に、in-app featuresをすぐ無効にするためentitlement_grant.revokedをlistenします。
  • subscriptionsとone-timesでテストする: License keyの動作は両者で微妙に異なるため、liveにする前に両方をテストしてください。
最終更新日 2026年7月31日