跳转到主要内容
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);
{
  "valid": true
}
无需 API 密钥:这是一个公共端点,无需身份验证。您可以直接从客户端应用程序、桌面软件或 CLI 调用它,以验证许可证密钥,而无需暴露您的 API 凭据。

Body

application/json
license_key
string
required
Example:

"2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43"

license_key_instance_id
string | null
Example:

"lki_123"

Response

License key validation result

valid
boolean
required
Example:

true