Validate a software license key.
POST /json/validateLicenseKey
[
'result' => 'success',
'data' => [
'valid' => true,
'license_key' => 'XXXX-XXXX-XXXX-XXXX',
'product_id' => 12345,
'product_name' => 'My Software',
'customer_email' => 'customer@example.com',
'purchase_date' => '2025-10-15 10:30:00',
'expires_at' => '2026-10-15 10:30:00',
'is_active' => true,
'activations_used' => 2,
'activations_max' => 5
]
]
use GoSuccess\Digistore24\Api\Digistore24;
use GoSuccess\Digistore24\Api\Client\Configuration;
// Initialize API client
$config = new Configuration('YOUR-API-KEY');
$api = new Digistore24($config);
// Validate a license key
$response = $api->license()->validateLicenseKey(
licenseKey: 'XXXX-XXXX-XXXX-XXXX',
productId: 12345
);
if ($response->valid) {
echo "License is valid for: " . $response->productName;
echo "Activations: {$response->activationsUsed}/{$response->activationsMax}";
} else {
echo "Invalid or expired license";
}