Documentation

License API Documentation

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.

Base URL

Production: https://products.rankhostzone.in/api

Authentication

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.

Activate License

POST /api/license.php?action=activate Activate a license on a domain

Parameters

ParameterTypeRequiredDescription
license_keystringRequiredThe license key from your purchase
domainstringRequiredDomain to activate (e.g., example.com)
machine_idstringOptionalUnique machine/installation identifier

Request Example

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"
  }'

Response 200 OK

{
  "success": true,
  "product": "Developer Portfolio Pro",
  "activations_remaining": 2,
  "expires_at": "2027-05-05"
}

Error Response 400

{
  "success": false,
  "error": "Maximum activations reached (3)"
}

Verify License

POST /api/license.php?action=verify Check if a license is valid for a domain
ParameterTypeRequiredDescription
license_keystringRequiredLicense key to verify
domainstringRequiredDomain to check

Response 200 OK

{
  "valid": true,
  "product": "Payment Gateway Suite",
  "version": "3.0.0",
  "expires_at": "2027-05-05"
}

Deactivate License

POST /api/license.php?action=deactivate Remove activation from a domain
ParameterTypeRequiredDescription
license_keystringRequiredLicense key
domainstringRequiredDomain to deactivate

Response 200 OK

{
  "success": true,
  "message": "Domain deactivated successfully"
}

License Info

GET /api/license.php?action=info&key=XXX Get full license details
ParameterTypeInDescription
keystringqueryLicense key to look up

Response 200 OK

{
  "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"
    }
  ]
}

Error Handling

CodeMeaningDescription
200SuccessRequest completed successfully
400Bad RequestMissing or invalid parameters
404Not FoundLicense or resource not found
429Rate LimitedToo many requests
500Server ErrorInternal server error

Rate Limits

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.

Integration Guide

PHP Integration

<?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');
}
?>

JavaScript Integration

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;
}