REST API
Licenses API
License validation and management
Licenses API
The licenses API provides online validation for additional security beyond offline verification.
Get License
GET /v1/licenses/:idReturns license details by ID.
Response
{
"id": "lic_xxx",
"productId": "prod_xxx",
"customerId": "cus_xxx",
"status": "active",
"features": ["pro", "beta"],
"issuedAt": 1704067200000,
"expiresAt": 1735689600000
}Validate License
POST /v1/licenses/validateValidates a license online, checking for revocation and expiration.
Request
{
"licenseKey": "eyJhbGciOi...",
"machineFingerprint": "machine_xxx"
}Response (Valid)
{
"valid": true,
"license": {
"id": "lic_xxx",
"status": "active",
"features": ["pro"],
"expiresAt": null
}
}Response (Invalid)
{
"valid": false,
"reason": "revoked"
}License Statuses
| Status | Description |
|---|---|
active | License is valid and usable |
expired | License has passed its expiration date |
revoked | License was manually revoked |
When to Use Online Validation
Offline verification is usually sufficient, but online validation is useful for:
- High-security applications - Verify license hasn't been revoked
- Subscription products - Check subscription is still active
- Feature flags - Get latest feature entitlements from server
The SDK handles this automatically with configurable refresh intervals.