Integrate license verification into your digital products
The RankHostZone License API allows you to activate, verify, and manage license keys for your purchased digital products. Use this API to implement license checks in your templates, scripts, modules, and other products.
License activation and verification endpoints use the license key itself for authentication. No additional API key is required for basic license operations.
For advanced API access (product management, analytics), use your API key in the X-API-Key header.
| Parameter | Type | Required | Description |
|---|---|---|---|
| license_key | string | Required | The license key from your purchase |
| domain | string | Required | Domain to activate (e.g., example.com) |
| machine_id | string | Optional | Unique machine/installation identifier |
curl -X POST https://products.rankhostzone.in/api/license.php?action=activate \ -H "Content-Type: application/json" \ -d '{ "license_key": "RHZ-A1B2C3D4-E5F6G7H8-I9J0K1L2-M3N4O5P6", "domain": "mywebsite.com" }'
{
"success": true,
"product": "Developer Portfolio Pro",
"activations_remaining": 2,
"expires_at": "2027-05-05"
}
{
"success": false,
"error": "Maximum activations reached (3)"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| license_key | string | Required | License key to verify |
| domain | string | Required | Domain to check |
{
"valid": true,
"product": "Payment Gateway Suite",
"version": "3.0.0",
"expires_at": "2027-05-05"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| license_key | string | Required | License key |
| domain | string | Required | Domain to deactivate |
{
"success": true,
"message": "Domain deactivated successfully"
}
| Parameter | Type | In | Description |
|---|---|---|---|
| key | string | query | License key to look up |
{
"success": true,
"license_key": "RHZ-A1B2C3D4-...",
"product": "CloudHost Theme",
"version": "1.8.0",
"status": "active",
"max_activations": 3,
"current_activations": 1,
"expires_at": "2027-05-05",
"activations": [
{
"domain": "mysite.com",
"status": "active",
"activated_at": "2026-05-05 10:30:00"
}
]
}
| Code | Meaning | Description |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Missing or invalid parameters |
| 404 | Not Found | License or resource not found |
| 429 | Rate Limited | Too many requests |
| 500 | Server Error | Internal server error |
API requests are limited to 100 requests per minute per IP address. License verification calls are cached for 5 minutes to reduce load. If you need higher limits, contact support.
<?php // Add this to your product's init file function rhz_verify_license($license_key, $domain = null) { $domain = $domain ?: $_SERVER['SERVER_NAME']; $ch = curl_init('https://products.rankhostzone.in/api/license.php?action=verify'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode([ 'license_key' => $license_key, 'domain' => $domain, ]), CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_TIMEOUT => 10, ]); $response = json_decode(curl_exec($ch), true); curl_close($ch); return $response['valid'] ?? false; } // Usage: if (!rhz_verify_license('RHZ-XXXX-XXXX-XXXX-XXXX')) { die('Invalid license. Purchase at products.rankhostzone.in'); } ?>
async function verifyLicense(key, domain) { const res = await fetch( 'https://products.rankhostzone.in/api/license.php?action=verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ license_key: key, domain }) }); return (await res.json()).valid === true; }