License Verification API

Secure license verification service

API Endpoint

POST JSON to verify a license with product code and domain binding:

POST /verify
Content-Type: application/json
X-Api-Secret: your-api-secret (optional)
User-Agent: YourApp/1.0 (optional)

{
  "license_key": "XXXX-XXXX-XXXX-XXXX",
  "product_code": "SEW-001",
  "domain": "example.com",
  "mode": "verify" // optional: "verify" (default) or "activate"
}

Request Headers:

Content-Type: application/json (required for JSON body)
X-Api-Secret: <secret> (optional, if API authentication is enabled)
User-Agent: <your-app> (optional, recommended for identification)

The server also checks the encrypted payload and the license file at https://<domain>/license/license.

License file format (choose one):

Plain text:
XXXX-XXXX-XXXX-XXXX
JSON:
{"license": "XXXX-XXXX-XXXX-XXXX"}
JSON (alternative):
{"license_key": "XXXX-XXXX-XXXX-XXXX"}

Response Examples

Success (200 OK)
{
  "ok": true,
  "license": {
    "id": 1,
    "license_key": "XXXX-XXXX-XXXX-XXXX",
    "product": "SEW-001",
    "domain": "example.com",
    "max_activations": 5,
    "activations": 2,
    "expires_at": "2025-12-31 23:59:59",
    "status": "active",
    "created_at": "2024-01-15 10:30:00",
    "updated_at": "2024-01-20 14:22:00"
  }
}
Error (400/401/403/404/429/500)
{
  "ok": false,
  "reason": "not_found",
  "message": "License not found in database",
  "error_code": "V008"
}

Common Error Reasons:

missing_fields - Required fields missing
not_found - License not found
expired - License has expired
not_active - License is revoked
domain_mismatch_db - Domain doesn't match
product_mismatch - Product code doesn't match
activation_limit_reached - Max activations exceeded
rate_limit_exceeded - Too many requests
unauthorized - Invalid API secret

Code Examples

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://yourdomain.com/verify');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'license_key' => 'XXXX-XXXX-XXXX-XXXX',
    'product_code' => 'SEW-001',
    'domain' => 'example.com',
    'mode' => 'verify' // optional: 'verify' (default) or 'activate'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'X-Api-Secret: your-api-secret', // optional
    'User-Agent: YourApp/1.0'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$result = json_decode($response, true);