Licenses API
List Licenses
GET /api/licensesQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
page | number | Page number (default: 1) |
per_page | number | Items per page (default: 20) |
search | string | Search by key or customer email |
status | string | Filter: active, expired, revoked, suspended |
product_id | string | Filter by product |
Response:
json
{
"items": [
{
"id": "lic_xxx",
"licenseKey": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"productId": "prd_xxx",
"planId": "pln_xxx",
"customerEmail": "[email protected]",
"customerName": "John Doe",
"status": "active",
"seats": 5,
"activatedCount": 2,
"expiresAt": "2026-12-31T23:59:59.000Z",
"product": {
"id": "prd_xxx",
"name": "My Plugin",
"slug": "my-plugin"
}
}
],
"pagination": { "page": 1, "perPage": 20, "total": 50, "totalPages": 3 }
}Get License
GET /api/licenses/:idReturns the license with its activations array.
Create License
POST /api/licensesjson
{
"productId": "prd_xxx",
"planId": "pln_xxx",
"customerEmail": "[email protected]",
"customerName": "John Doe",
"seats": 5,
"expiresAt": "2026-12-31T23:59:59Z"
}The license key is auto-generated using the product's license prefix.
Update License
PUT /api/licenses/:idjson
{
"customerEmail": "[email protected]",
"status": "active",
"seats": 10,
"expiresAt": "2027-12-31T23:59:59Z"
}Delete License
DELETE /api/licenses/:idRevoke License
POST /api/licenses/:id/revokeSets status to revoked and deactivates all activations.
Regenerate License Key
POST /api/licenses/:id/regenerateGenerates a new license key. The old key immediately stops working.
