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

FieldTypeDescription
idstring (UUID)Unique license key identifier
keystringThe license key string
productstring (UUID)Associated product ID
customer_emailstringCustomer who owns the key
statusstringStatus: active, expired, disabled
activation_limitintegerMaximum number of activations (null = unlimited)
activation_countintegerCurrent number of activations
expires_atdatetimeExpiration date (null = never)
metadataobjectArbitrary 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"
}