Quickstart: Check Entitlements (5 minutes)
Last updated: Phase 8.5
Prerequisites
- A ValidonX API key
- A valid license key
- Feature codes to check
Step 1: Check Features
bash
curl -X POST https://api.validonx.com/api/v1/integration/entitlements/check \
-H "X-API-Key: vx_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"license_key": "YOUR-LICENSE-KEY",
"features": ["features.export", "activations.max", "features.advanced_analytics"]
}'Step 2: Read the Response
json
{
"data": {
"entitlements": {
"features": {
"features.export": { "granted": true, "value": true },
"activations.max": { "granted": true, "value": 10 },
"features.advanced_analytics": { "granted": false, "value": null }
},
"limits": {
"activations.max": { "limit": 10, "type": "metered" }
}
}
},
"meta": { "request_id": "uuid", "api_version": "1" }
}Step 3: Gate Features in Your App
javascript
const { features } = result.data.entitlements
if (features['features.export'].granted) {
showExportButton()
}
if (features['features.advanced_analytics'].granted) {
showAnalyticsDashboard()
} else {
showUpgradePrompt()
}Common Errors
| Code | Meaning | Fix |
|---|---|---|
LICENSE.NOT_FOUND | Bad license key | Verify the key |
AUTH.INVALID_API_KEY | Bad API key | Check header |