Điểm cuối này cho phép bạn xác thực giấy phép cho người dùng.
POST
/
licenses
/
validate
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.validate({ license_key: '2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43',});console.log(response.valid);
Use this file to discover all available pages before exploring further.
Không cần API Key: Đây là một endpoint 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ừ ứng dụng client, phần mềm máy tính để bàn hoặc CLI để xác thực các khóa giấy phép mà không làm lộ thông tin xác thực API của bạn.
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.validate({ license_key: '2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43',});console.log(response.valid);