API Integration Guide

Learn how to verify licenses in your applications using our simple validation endpoints.

1. Endpoint URL

All verify requests must be sent to the endpoint via POST.

POST http://lg.ikhsanhamid.my.id/api/verify.php

2. Verifying a License Key

If your application uses simple license keys, send the type: "key" parameter.

cURL Example

curl -X POST http://lg.ikhsanhamid.my.id/api/verify.php \
-H "Content-Type: application/json" \
-d '{
    "app_key": "YOUR_APP_KEY",
    "type": "key",
    "license_key": "USER_LICENSE_KEY_INPUT",
    "device_id": "UNIQUE_HARDWARE_ID" 
}'

* device_id is highly recommended to enforce device/domain activation limits.

3. Verifying using Credentials

If your application uses user accounts, send the type: "credentials" parameter alongside the username and password.

JavaScript (Fetch API) Example

async function verifyLicense() {
    // You can use the domain as the device_id for web apps
    const deviceId = window.location.hostname; 
    
    const response = await fetch("http://lg.ikhsanhamid.my.id/api/verify.php", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
            app_key: "YOUR_APP_KEY",
            type: "credentials",
            username: "demo_user",
            password: "secure_password123",
            device_id: deviceId
        })
    });
    
    const result = await response.json();
    
    if (response.ok && result.status === 'success') {
        console.log("License is Valid! Proceed to application.");
    } else {
        console.error("Verification failed:", result.message);
    }
}

4. Response Format

The API always returns a JSON object. The HTTP Status Code determines success (200) or failure (4xx).

Success (200 OK)

{
  "status": "success",
  "message": "License is valid"
}

Error (401 Unauthorized)

{
  "status": "error",
  "message": "Invalid or inactive license key"
}