Back to Help Center

API Documentation

License validation and integration API

License Validation API

Validate myFamilyCodex licenses programmatically.

Endpoint

POST https://familycodex.org/sales/api/

Request Parameters

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

Example Request

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"
  }'

Response Format

{
  "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 Responses

"error": "Invalid license key"
"error": "License expired"
"error": "Domain mismatch"

PHP Integration Example

<?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'];
}
?>

Security Best Practices

Need Help?

Our development team is here to assist with API integration.

Contact Developer Support