Skip to content

Entitlements & Usage Metering

Entitlements define what features and resource limits a tenant has access to based on their subscription plan. Usage metering tracks consumption against those limits.

Entitlement Types

TypeDescriptionExample
booleanFeature on/off toggleapi_access: true, webhooks: true
meteredNumeric limit with usage trackingmax_products: 5, api_calls_monthly: 100000
planPlan-specific entitlement from plan_entitlements tableSeeded during provisioning

How Entitlements Are Assigned

  1. During provisioning (Stage 6): Default entitlements are seeded from the plan's plan_entitlements records plus config defaults
  2. On plan change: Entitlements are recalculated based on the new plan
  3. Admin override: Tenant-specific overrides can be applied via feature flags

Checking Entitlements

API Endpoint: POST /v1/integration/entitlements/check

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 '{"entitlement_codes": ["webhooks", "api_access"]}'

Response:

json
{
  "data": {
    "webhooks": { "entitled": true, "type": "boolean", "value": true },
    "api_access": { "entitled": true, "type": "boolean", "value": true }
  },
  "meta": { "request_id": "uuid", "api_version": "1" }
}

Usage Metering

Recording usage: POST /v1/integration/usage/record

bash
curl -X POST https://api.validonx.com/api/v1/integration/usage/record \
  -H "X-API-Key: VX-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"metric": "api_calls", "value": 1}'

Usage events are stored in the tenant database (usage_events table) and aggregated into usage_snapshots for reporting.

Plan Limits

FeatureStarterProEnterprise
Products15Unlimited
License keys100UnlimitedUnlimited
Activations500UnlimitedUnlimited
API calls/month10,000100,000Unlimited
Webhooks1 endpoint5 endpointsUnlimited

Rate Limiting Integration

Usage-based rate limits (Layer 4) enforce plan quotas. When a tenant approaches their monthly limit:

  • At 80%: notification triggered (if configured)
  • At 100%: requests return 429 RATE_LIMIT.EXCEEDED

Enterprise plans with unlimited quotas bypass usage-based rate limiting.

Built by Veltara Works