Passer au contenu principal
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>"
  }
}
Aucune clé API requise : Il s’agit d’un endpoint public qui ne nécessite pas d’authentification. Vous pouvez l’appeler directement depuis des applications clientes, des logiciels de bureau ou des CLIs pour activer des clés de licence sans exposer vos identifiants API.

Corps

application/json
license_key
string
requis
name
string
requis

Réponse

License key instance created

business_id
string
requis

Business ID

created_at
string<date-time>
requis

Creation timestamp

Exemple:

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

customer
object
requis

Limited customer details associated with the license key.

id
string
requis

License key instance ID

Exemple:

"lki_123"

license_key_id
string
requis

Associated license key ID

Exemple:

"lic_123"

name
string
requis

Instance name

Exemple:

"Production Server 1"

product
object
requis

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