メインコンテンツへスキップ
POST
/
licenses
/
activate
JavaScript
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});

const response = await client.licenses.activate({ license_key: 'license_key', name: 'name' });

console.log(response.id);
{
  "business_id": "<string>",
  "created_at": "2024-01-01T00:00:00Z",
  "customer": {
    "customer_id": "<string>",
    "email": "<string>",
    "name": "<string>",
    "metadata": {},
    "phone_number": "<string>"
  },
  "id": "lki_123",
  "license_key_id": "lic_123",
  "name": "Production Server 1",
  "product": {
    "product_id": "<string>",
    "name": "<string>"
  }
}
APIキーは不要: これは認証を必要としない公開エンドポイントです。クライアントアプリケーション、デスクトップソフトウェア、またはCLIから直接呼び出して、API資格情報を公開することなくライセンスキーをアクティブ化できます。

ボディ

application/json
license_key
string
必須
name
string
必須

レスポンス

License key instance created

business_id
string
必須

Business ID

created_at
string<date-time>
必須

Creation timestamp

:

"2024-01-01T00:00:00Z"

customer
object
必須

Limited customer details associated with the license key.

id
string
必須

License key instance ID

:

"lki_123"

license_key_id
string
必須

Associated license key ID

:

"lic_123"

name
string
必須

Instance name

:

"Production Server 1"

product
object
必須

Related product info. Present if the license key is tied to a product.