API & License Documentation
Verify purchases, manage licenses, and integrate Kodester’s license system into your products.
License Format
24-character alphanumeric key with dash separators (e.g., a1b2c3-d4e5f6-g7h8i9-j0k1l2-m3n4o5)
Documentation
The Kodester API allows both sellers and buyers to interact with the license system programmatically. Sellers can verify purchases, check license validity, and activate licenses within their own products. Buyers can verify their license keys and manage their activated installations.
The API is built as a RESTful service and uses standard HTTP methods. All responses are returned in JSON format. The base URL for all API requests is:
https://api.kodester.com/v1/
All API requests must be made over HTTPS. Unencrypted HTTP requests will be rejected. Rate limiting is applied at 60 requests per minute per API key. Exceeding this limit will return a 429 Too Many Requests response.
Every license issued by Kodester is a unique 24-character alphanumeric string. The key is formatted in groups separated by dashes for readability. Each license key is randomly generated using a cryptographically secure method, ensuring uniqueness and unpredictability.
Structure
A license key consists of 24 characters (letters a–z and numbers 0–9) divided into 5 groups:
Properties
- Total Length: 24 alphanumeric characters (excluding dashes)
- Character Set: a–z (lowercase) and 0–9
- Separator: Dash (
-) between each 6-character group - Display Format:
xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx - Validation: Case-insensitive (uppercase and lowercase are treated equally)
- Uniqueness: Each license key is globally unique and tied to a specific purchase
The Kodester API provides the following endpoints for license management. All endpoints require authentication via your seller API key unless otherwise noted.
Verify the validity of a license key. Returns license details including purchase info, license type, activation count, and expiration status.
Activate a license key on a specific domain or installation. Returns an activation token that should be stored locally by the application.
Deactivate a license key from a specific domain or installation. Useful when moving an installation to a new server or domain.
Get detailed information about a license key including product details, buyer information, purchase date, and all active installations.
Verify a purchase using the purchase code. Returns product details, buyer details, and license information associated with the purchase.
Check if a purchase code is valid and has not been refunded or disputed. Ideal for pre-download or pre-installation verification.
License verification is the most commonly used API operation. It allows you to check whether a license key is valid, active, and has not exceeded its activation limit. Use this endpoint to validate licenses within your product during installation or at runtime.
Request
GET https://api.kodester.com/v1/license/verify
Parameters
license_keyproduct_iddomainResponse (Success)
{
"status": "success",
"data": {
"valid": true,
"license_key": "a1b2c3-d4e5f6-g7h8i9-j0k1l2-m3n4o5",
"license_type": "regular",
"product_id": 12345,
"product_name": "PHP Dashboard Builder",
"buyer_id": 67890,
"buyer_name": "John Doe",
"purchase_date": "2026-01-15T10:30:00Z",
"activated_domains": ["example.com", "staging.example.com"],
"activation_limit": 2,
"activation_count": 2,
"support_expires": "2027-01-15T10:30:00Z",
"is_refunded": false
}
}
Response (Invalid License)
{
"status": "error",
"message": "License key not found or invalid.",
"error_code": "LICENSE_NOT_FOUND"
}
Activation registers a license key to a specific domain or installation. Once activated, the license is tied to that domain and cannot be used on additional domains unless deactivated first. This helps sellers protect their products from unauthorized distribution.
Request
POST https://api.kodester.com/v1/license/activate
Parameters
license_keyproduct_iddomainversionResponse (Success)
{
"status": "success",
"message": "License activated successfully.",
"data": {
"activation_token": "tkn_8f3a2b1c9d4e5f6a7b8c9d0e",
"activated_domain": "example.com",
"activation_count": 1,
"activation_limit": 2,
"remaining_activations": 1
}
}
Response (Limit Exceeded)
{
"status": "error",
"message": "License activation limit reached. Deactivate a domain first.",
"error_code": "ACTIVATION_LIMIT_EXCEEDED",
"data": {
"activation_limit": 2,
"activation_count": 2,
"activated_domains": ["example.com", "staging.example.com"]
}
}
As a seller on Kodester, integrating the license API into your products ensures that only legitimate buyers can use your software. Follow these steps to implement license verification in your product:
Step 1: Get Your Seller API Key
Navigate to your Seller Dashboard in your Kodester account settings. Under the API Settings section, generate a new API key. This key is required to authenticate your API requests. Keep your API key secure and never expose it in client-side code.
Step 2: Implement Verification on Install
When a buyer installs your product, prompt them to enter their license key. Send a verification request to the Kodester API. If the license is valid, store the license key locally and allow the installation to proceed. If invalid, display an error message with a link to the buyer’s Kodester purchase page.
Step 3: Activate the License
After successful verification, send an activation request with the buyer’s domain. Store the returned activation token securely. This token is used for future verification requests without requiring the full license key each time.
Step 4: Periodic License Checks
Optionally, implement periodic license validation (e.g., weekly or monthly) to check if the license is still valid, has not been refunded, and is still associated with the same domain. This provides ongoing protection against license sharing and refund abuse.
Step 5: Handle Graceful Degradation
Always handle API failures gracefully. If the Kodester API is temporarily unavailable, your product should continue to function for a reasonable period (e.g., 7 days) using the cached license data. This prevents legitimate users from being locked out due to temporary API issues.
The Kodester API returns standard HTTP status codes along with JSON error responses. Your application should handle these errors appropriately to provide a good user experience. Below is a list of common error codes you may encounter:
400401403403404410429500Below are practical code examples for integrating the Kodester license API into your products. These examples demonstrate the most common operations: verification, activation, and deactivation.
PHP — Verify a License
$apiKey = 'your_seller_api_key';
$licenseKey = 'a1b2c3-d4e5f6-g7h8i9-j0k1l2-m3n4o5';
$productId = 12345;
$ch = curl_init('https://api.kodester.com/v1/license/verify');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode([
'license_key' => $licenseKey,
'product_id' => $productId
])
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if ($data['status'] === 'success' && $data['data']['valid']) {
echo "License is valid!";
} else {
echo "License error: " . $data['message'];
}
PHP — Activate a License
$ch = curl_init('https://api.kodester.com/v1/license/activate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode([
'license_key' => $licenseKey,
'product_id' => $productId,
'domain' => $_SERVER['SERVER_NAME']
])
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if ($data['status'] === 'success') {
// Store activation token securely
file_put_contents('.license_token', $data['data']['activation_token']);
echo "License activated for " . $data['data']['activated_domain'];
} else {
echo "Activation failed: " . $data['message'];
}
JavaScript — Verify a License
async function verifyLicense(licenseKey, productId) {
const response = await fetch('https://api.kodester.com/v1/license/verify', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ license_key: licenseKey, product_id: productId })
});
const data = await response.json();
return data;
}
// Usage
const result = await verifyLicense('a1b2c3-d4e5f6-g7h8i9-j0k1l2-m3n4o5', 12345);
console.log(result.status === 'success' ? 'Valid!' : result.message);
If you have purchased a product on Kodester that requires license activation, follow these steps to activate and manage your license. Each purchase comes with a unique license key that you can find on your order page.
Finding Your License Key
Log in to your Kodester account and navigate to My Purchases. Find the product you purchased and click on the order details. Your license key will be displayed in the format: xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx. Copy this key and paste it into the product’s activation screen.
Activating Your License
During the product installation or setup process, you will be prompted to enter your license key. Paste the key you copied from your purchase page. The product will verify the key with Kodester’s servers and activate your license for your domain or installation. Make sure you are installing on the correct domain, as the license will be tied to it.
Managing Activations
Each license has a limited number of activations depending on the license type. If you need to move your installation to a new domain, first deactivate the license from the old domain. You can do this from the product’s settings or by contacting the seller for assistance. Once deactivated, you can activate the license on the new domain.
License Not Working?
If your license key is not accepted, please check the following:
- Ensure you have entered the complete 24-character license key correctly, including all dashes.
- Make sure you have not exceeded the activation limit for your license.
- Verify that your purchase has not been refunded or disputed.
- Contact the seller’s support team for further assistance if the issue persists.
- If you believe there is an error with your license, contact Kodester support.