Skip to content

Licenses API

List Licenses

GET /api/licenses

Query Parameters:

ParameterTypeDescription
pagenumberPage number (default: 1)
per_pagenumberItems per page (default: 20)
searchstringSearch by key or customer email
statusstringFilter: active, expired, revoked, suspended
product_idstringFilter 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/:id

Returns the license with its activations array.

Create License

POST /api/licenses
json
{
  "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/:id
json
{
  "customerEmail": "[email protected]",
  "status": "active",
  "seats": 10,
  "expiresAt": "2027-12-31T23:59:59Z"
}

Delete License

DELETE /api/licenses/:id

Revoke License

POST /api/licenses/:id/revoke

Sets status to revoked and deactivates all activations.

Regenerate License Key

POST /api/licenses/:id/regenerate

Generates a new license key. The old key immediately stops working.