License Keys API
Issue, validate, and manage software license keys. License keys are automatically generated when a customer purchases a digital product with license key delivery enabled.
Endpoints
GET
/api/v1/payment/license-keys/List all license keys for your merchant
POST
/api/v1/payment/license-keys/Create a new license key
GET
/api/v1/payment/license-keys/{id}/Retrieve a specific license key
PATCH
/api/v1/payment/license-keys/{id}/Update a license key
POST
/api/v1/payment/license-keys/validate/Validate a license key (public)
POST
/api/v1/payment/license-keys/activate/Activate a license key (public)
POST
/api/v1/payment/license-keys/deactivate/Deactivate a license key (public)
GET
/api/v1/payment/portal/{token}/license-keys/Customer portal: list owned keys
License Key Object
| Field | Type | Description |
|---|---|---|
| id | string (UUID) | Unique license key identifier |
| key | string | The license key string |
| product | string (UUID) | Associated product ID |
| customer_email | string | Customer who owns the key |
| status | string | Status: active, expired, disabled |
| activation_limit | integer | Maximum number of activations (null = unlimited) |
| activation_count | integer | Current number of activations |
| expires_at | datetime | Expiration date (null = never) |
| metadata | object | Arbitrary key-value metadata |
Example: Validate License Key
curl -X POST https://api.clappay.com/api/v1/payment/license-keys/validate/ \
-H "Content-Type: application/json" \
-d '{
"license_key": "XXXX-XXXX-XXXX-XXXX",
"instance_name": "Johns MacBook Pro"
}'
# Response:
{
"valid": true,
"license_key": {
"id": "lk_abc123",
"key": "XXXX-XXXX-XXXX-XXXX",
"status": "active",
"activation_count": 1,
"activation_limit": 5,
"product_name": "Premium App"
}
}Example: Activate License Key
curl -X POST https://api.clappay.com/api/v1/payment/license-keys/activate/ \
-H "Content-Type: application/json" \
-d '{
"license_key": "XXXX-XXXX-XXXX-XXXX",
"instance_name": "Production Server"
}'
# Response:
{
"activated": true,
"activation_count": 2,
"activation_limit": 5,
"instance_id": "inst_xyz789"
}