Developer Docs

Designed for developers

Ship faster with our powerful and easy-to-use APIs.

API Endpoints

Our REST API is the core of the system. You can interact with it from any programming language that can make HTTP requests.


Supported Languages

Code examples are provided in PHP (cURL), Python (Requests), and JavaScript (Fetch). The API will work with any language.


Endpoint: Verify License

Checks if a license key is valid, active, and belongs to the specified product.

POST /api/v1/license/verify

Parameters

  • license_key (string, required) - The user's license key.
  • product_sku (string, required) - The unique SKU of your product.

Example Request (Python)


import requests

api_url = 'https://license-master.ruptechnologies.com/api/v1/license/verify'
payload = {
    'license_key': 'LMS-XXXX-XXXX-XXXX',
    'product_sku': 'YOUR-PRODUCT-SKU'
}

response = requests.post(api_url, data=payload)

if response.status_code == 200:
    print("License is valid!")
    print(response.json())
else:
    print("License is invalid or error occurred.")
    print(response.json())
    

Success Response (200 OK)


{
  "success": true,
  "message": "License is valid.",
  "data": {
    "status": "active",
    "expires_at": null,
    "activations_count": 0,
    "activation_limit": 1
  }
}
    

Endpoint: Activate License

Activates a license key and links it to a specific domain. This counts against the activation limit.

POST /api/v1/license/activate

Parameters

  • license_key (string, required)
  • product_sku (string, required)
  • domain (string, required) - The domain of the site where the license is being activated (e.g., `https://example.com`).

Example Request (JavaScript)


const apiUrl = 'https://license-master.ruptechnologies.com/api/v1/license/activate';
const payload = new URLSearchParams({
    'license_key': 'LMS-XXXX-XXXX-XXXX',
    'product_sku': 'YOUR-PRODUCT-SKU',
    'domain': 'https://example.com'
});

fetch(apiUrl, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Accept': 'application/json'
    },
    body: payload
})
.then(res => res.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
    

WordPress SDK Integration

For WordPress plugin and theme developers, our PHP SDK provides the quickest and most secure way to integrate.

Step 1: Include the SDK

Place the downloaded `sdk.php` file in your plugin folder and include it.

require_once __DIR__ . '/sdk/sdk.php';

Step 2: Initialize the SDK

Instantiate the SDK with your product's unique SKU. You can find the SKU on your Products page.


// Replace 'YOUR-PRODUCT-SKU' and provide the main plugin file path.
$sdk = new LicenseMasterClientSDK('YOUR-PRODUCT-SKU', __FILE__);
    

Step 3: Protect Premium Features

Use the `is_active()` method to check if the license is valid before showing premium content.


if ($sdk->is_active()) {
    // User is verified, show the premium content.
} else {
    // User is not verified, show an activation notice.
}
    

Step 4: Enable Automatic Updates

To enable automatic updates for your plugin, simply call the `init_updater()` method.


// This hooks into the WordPress update system.
$sdk->init_updater();
    

Deployment Guide

To deploy the License Master application on your own server (cPanel or VPS), follow these steps.

1. Prepare Files

On your local computer, run `composer install --no-dev` and `npm run build`. Then, create a `.zip` archive of your project folder.

2. Upload and Extract

Upload the `.zip` file to your server and extract it into your desired directory (e.g., `/home/user/my-app`).

3. Configure Web Server

Point your domain's "Document Root" or "Web Root" to the `/public` directory inside your project folder. This is a critical security step.

4. Create `.env` File

Copy `.env.example` to a new file named `.env`. Generate a new `APP_KEY` and fill in your database credentials.

5. Run Installation

For a product using our installer, simply visit your domain in a browser to start the web-based setup wizard. For manual setup, run the following commands via SSH:


# In your project directory on the server
php artisan migrate --seed --force
php artisan optimize