$_tuish
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/:id

Returns 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/validate

Validates 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

StatusDescription
activeLicense is valid and usable
expiredLicense has passed its expiration date
revokedLicense 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.