الانتقال إلى المحتوى الرئيسي
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: هذه نقطة نهائية عامة لا تتطلب مصادقة. يمكنك استدعاؤها مباشرة من تطبيقات العميل، أو البرامج المكتبية، أو واجهات سطر الأوامر لتفعيل مفاتيح الترخيص دون كشف بيانات اعتماد 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.