One-line license verification for your applications
curl -O https://lisensetech.com/downloads/lisense.zip
<?php
// Single-line integration
require_once __DIR__.'/path/to/lisense/laas_client.php';
if (!defined('LAAS_CLIENT_LOADED')) {
http_response_code(500);
echo 'laas_client.php was not loaded correctly.';
exit;
};
// License verification happens automatically
?>
/license-error.php
laas_client.php is a convenience wrapper — the license check itself is one plain HTTPS POST with a JSON body. Any language that can make an HTTP request can integrate directly against the same endpoint PHP uses.
POST https://lisensetech.com/api/v1/validate.php
license_code, app_id, domain
domain should be the calling app's own hostname — send the same value every time. A license auto-binds to whatever domain first validates it successfully, so an omitted or inconsistent value will make later calls fail domain matching even though the license itself is fine. If your app has an API key configured, send it as an X-API-Key header.
import requests
response = requests.post(
"https://lisensetech.com/api/v1/validate.php",
json={
"license_code": "YOUR_LICENSE_CODE",
"app_id": 1,
"domain": "yourapp.com",
},
timeout=5,
)
data = response.json()
if not data.get("valid"):
raise SystemExit(f"License invalid: {data.get('error')}")
const res = await fetch("https://lisensetech.com/api/v1/validate.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
license_code: "YOUR_LICENSE_CODE",
app_id: 1,
domain: "yourapp.com",
}),
});
const data = await res.json();
if (!data.valid) {
throw new Error(`License invalid: ${data.error}`);
}
curl -X POST https://lisensetech.com/api/v1/validate.php \
-H "Content-Type: application/json" \
-d '{
"license_code": "YOUR_LICENSE_CODE",
"app_id": 1,
"domain": "yourapp.com"
}'
{
"valid": true,
"license_code": "LAAS-A1B2-C3D4E5F6",
"app": "Your App",
"expiry_date": "2026-12-31",
"days_remaining": 132,
"flags": {}
}
On failure, valid is false and an error code is included — see Error Handling for the full list. There's no PHP-specific behavior in the response itself; build your own equivalent of laas_client.php's caching/retry/redirect logic in your own language if you want the same resilience.
<?php
// license-error.php
session_start();
$error = $_SESSION['license_error'] ?? [
'code' => 'unknown',
'message' => 'License verification failed'
];
?>
<!-- Your HTML here -->
<div class="error-message">
<h1>Error: <?= htmlspecialchars($error['code']) ?></h1>
<p><?= htmlspecialchars($error['message']) ?></p>
<?php if (isset($error['renewal_url'])): ?>
<a href="<?= $error['renewal_url'] ?>">Renew License</a>
<?php endif; ?>
</div>
| Code | Description |
|---|---|
| expired | License has expired |
| invalid_format | License code doesn't match the LAAS-XXXX-XXXXXXXX format |
| not_found_or_domain_mismatch | License doesn't exist for this app, or the calling domain doesn't match the domain it's bound to |
| sandbox_license_wrong_endpoint | A sandbox/test license was sent to the real endpoint — use /api/v1/sandbox/validate.php instead |
| concurrent_limit_exceeded | Floating license already at its max concurrent instance limit |
| missing_instance_id | A floating license requires an instance_id in the request |
| invalid_api_key | This app requires an API key (X-API-Key header) and none, or an invalid one, was sent |
| rate_limit_exceeded / app_rate_limit_exceeded | Too many verification attempts — per-IP or per-app limit hit |
| database_error / system_error | Server-side failure — safe to retry |
| connection_failed | Client-side: could not reach the API at all (network issue) |
final class LAAS {
const API_URL = 'https://lisensetech.com/api/v1/validate.php';
const LICENSE_CODE = 'YOUR_LICENSE_CODE'; // Set your license here
const APP_ID = 1; // Your application ID
const CACHE_TTL = 86400; // Cache duration in seconds (24h)
}
These are the constants you edit at the top of the downloaded laas_client.php — you don't need to write this class yourself.
Test different license scenarios without affecting your production environment. This sandbox simulates API responses for development and debugging purposes.
{
"status": "Select a scenario to test"
}
Download lisense.zip, which contains laas_client.php
Include it in your application code: require 'lisense/laas_client.php';
Set your license code in the client file
Create license-error.php at your app root (a working template is included in the zip)