Endpoint Verification
https://kiosdev.com/api/v1/license/verify
https://kiosdev.com/api/v1/license/checkPayload
{
"license_key": "ABCDE-FGHIJ-KLMNO-PQRST-UVWXY",
"domain": "domain.customer.com",
"ip": "203.0.113.10"
}
Field ip opsional. Jika kosong, server memakai IP request.
API Tester
Tes license langsung dari halaman ini ke endpoint server Anda.
Response
Response
{
"valid": true,
"code": "license_valid",
"message": "License valid",
"data": {
"domain": "domain.customer.com",
"expires_at": "2027-01-01T00:00:00+00:00",
"max_activations": 3
}
}
{
"valid": false,
"code": "license_expired",
"message": "License has expired."
}
Contoh Request
cURL
curl -X POST "https://kiosdev.com/api/v1/license/verify" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"license_key":"ABCDE-FGHIJ-KLMNO-PQRST-UVWXY","domain":"domain.customer.com"}'
PHP Native
<?php
$payload = [
'license_key' => 'ABCDE-FGHIJ-KLMNO-PQRST-UVWXY',
'domain' => $_SERVER['HTTP_HOST'],
];
$ch = curl_init('https://kiosdev.com/api/v1/license/verify');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Accept: application/json', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_TIMEOUT => 10,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if (! ($response['valid'] ?? false)) {
exit('License invalid: '.($response['message'] ?? 'Unknown error'));
}
JavaScript
const response = await fetch('https://kiosdev.com/api/v1/license/verify', {
method: 'POST',
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({
license_key: 'ABCDE-FGHIJ-KLMNO-PQRST-UVWXY',
domain: window.location.hostname
})
});
const result = await response.json();
if (!result.valid) {
throw new Error(result.message);
}
Error Codes
| license_not_found | License key tidak ada di database. |
| license_suspended | License dinonaktifkan oleh admin. |
| license_expired | Tanggal expired sudah lewat. |
| activation_limit_reached | Jumlah domain sudah mencapai max activations. |
| domain_registered_to_other_license | Domain sudah terdaftar pada license lain. |
| domain_blacklisted | Domain masuk blacklist. |
| invalid_domain | Domain kosong atau tidak bisa diproses. |
| invalid_payload | Payload request tidak lengkap atau format license key salah. |
| app_not_installed | Server license belum selesai instalasi. |
Petunjuk Integrasi
Simpan license key di konfigurasi aplikasi customer, lalu lakukan verify saat instalasi pertama dan check berkala saat aplikasi dibuka atau melalui scheduler.
Folder client-example/ berisi contoh PHP native dengan modal license dan middleware Laravel yang bisa dicopy ke aplikasi customer.
Untuk cache, simpan response valid di session atau file cache lokal dengan TTL pendek, misalnya 6-24 jam. Tetap lakukan check periodik supaya suspend, expired, dan blacklist aktif.