Skip to content

Create License

Create a new license.

POST /v1/licenses

Request Body

json
{
  "productId": "prd_xxx",
  "planId": "pln_xxx",
  "customerEmail": "customer@example.com",
  "customerName": "John Doe",
  "seats": 5,
  "expiresAt": "2027-02-06T00:00:00.000Z"
}
FieldRequiredTypeDescription
productIdYesstringProduct ID
planIdNostringPlan ID
customerEmailYesstringCustomer email (creates customer if not exists)
customerNameNostringCustomer name
customerIdNostringExisting customer ID (alternative to email)
seatsNonumberMax activations (default: 1)
expiresAtNostringExpiration date (ISO 8601)

Response

json
{
  "data": {
    "id": "lic_xxx",
    "licenseKey": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
    "productId": "prd_xxx",
    "customerId": "cus_xxx",
    "status": "active",
    "seats": 5,
    "activatedCount": 0,
    "expiresAt": "2027-02-06T00:00:00.000Z",
    "createdAt": "2026-02-06T00:00:00.000Z"
  }
}

Example

bash
curl -X POST "https://api.packedge.dev/v1/licenses" \
  -H "Authorization: Bearer pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "prd_xxx",
    "customerEmail": "customer@example.com",
    "seats": 5,
    "expiresAt": "2027-02-06T00:00:00.000Z"
  }'