Hoppa till huvudinnehåll
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
}
Ingen API-nyckel krävs: Detta är en offentlig endpoint som inte kräver autentisering. Du kan anropa den direkt från klientapplikationer, skrivbordsprogram eller CLIs för att validera licensnycklar utan att exponera dina API-uppgifter.

Kropp

application/json
license_key
string
obligatorisk
Exempel:

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

license_key_instance_id
string | null
Exempel:

"lki_123"

Svar

License key validation result

valid
boolean
obligatorisk
Exempel:

true