Chuyển đến nội dung chính
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>"
  }
}
Không cần API Key: Đây là một điểm cuối công khai không yêu cầu xác thực. Bạn có thể gọi nó trực tiếp từ các ứng dụng khách, phần mềm máy tính để bàn hoặc CLIs để kích hoạt các khóa giấy phép mà không cần tiết lộ thông tin xác thực API của bạn.

Nội dung

application/json
license_key
string
bắt buộc
name
string
bắt buộc

Phản hồi

License key instance created

business_id
string
bắt buộc

Business ID

created_at
string<date-time>
bắt buộc

Creation timestamp

Ví dụ:

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

customer
object
bắt buộc

Limited customer details associated with the license key.

id
string
bắt buộc

License key instance ID

Ví dụ:

"lki_123"

license_key_id
string
bắt buộc

Associated license key ID

Ví dụ:

"lic_123"

name
string
bắt buộc

Instance name

Ví dụ:

"Production Server 1"

product
object
bắt buộc

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