Validate myFamilyCodex licenses programmatically.
POST https://familycodex.org/sales/api/
| Parameter | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | Must be "validate" |
| license_key | string | Yes | The license key to validate |
| domain | string | Yes | Domain where license is installed |
curl -X POST https://familycodex.org/sales/api/ \
-H "Content-Type: application/json" \
-d '{
"action": "validate",
"license_key": "FC-XXXX-XXXX-XXXX-XXXX",
"domain": "example.com"
}'
{
"success": true,
"license": {
"license_key": "FC-XXXX-XXXX-XXXX-XXXX",
"license_type": "pro",
"status": "active",
"domain": "example.com",
"expires_at": "2026-12-05",
"max_users": -1,
"max_people": -1,
"max_photos": 10000
},
"features": {
"gedcom_export": true,
"ai_features": true,
"media_manager": true,
"analytics": true
}
}
"error": "Invalid license key"
"error": "License expired"
"error": "Domain mismatch"
<?php
function validateLicense($licenseKey, $domain) {
$url = 'https://familycodex.org/sales/api/';
$data = [
'action' => 'validate',
'license_key' => $licenseKey,
'domain' => $domain
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Usage
$result = validateLicense('FC-XXXX-XXXX-XXXX-XXXX', 'example.com');
if ($result['success']) {
echo "License is valid!";
echo "Type: " . $result['license']['license_type'];
} else {
echo "Error: " . $result['error'];
}
?>