Quickstart: Validate a License (5 minutes)
Last updated: Phase 8.5
Prerequisites
- A ValidonX API key (obtain from your Tenant Dashboard at
/app/api-keys) - A license key to validate
Step 1: Make the Request
bash
curl -X POST https://api.validonx.com/api/v1/integration/licenses/YOUR-LICENSE-KEY/validate \
-H "X-API-Key: vx_your_api_key" \
-H "Content-Type: application/json"Step 2: Check the Response
Success:
json
{
"data": {
"valid": true,
"license": {
"id": 42,
"key": "YOUR-LICENSE-KEY",
"type": "subscription",
"status": "active",
"expires_at": "2027-03-30T00:00:00.000000Z"
}
},
"meta": { "request_id": "uuid", "api_version": "1" }
}Step 3: Handle in Your App
JavaScript:
javascript
const res = await fetch(`https://api.validonx.com/api/v1/integration/licenses/${licenseKey}/validate`, {
method: 'POST',
headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' },
})
const { data } = await res.json()
if (data.valid) {
// License is valid — proceed
} else {
// License expired or invalid — restrict access
}Python:
python
import requests
r = requests.post(f"https://api.validonx.com/api/v1/integration/licenses/{license_key}/validate",
headers={"X-API-Key": api_key})
data = r.json()["data"]
if data["valid"]:
print("License valid")Common Errors
| Code | Meaning | Fix |
|---|---|---|
LICENSE.NOT_FOUND | Key doesn't exist | Check the key value |
LICENSE.REVOKED | Key was revoked | Contact your admin |
AUTH.INVALID_API_KEY | Bad API key | Check your X-API-Key header |