Query
Parameters
Query parameters for fetching the entitlement
Return Type
Returns anEntitlement object with:
| Field | Type | Description |
|---|---|---|
isGranted | Boolean | Whether access is granted |
hasUnlimitedUsage | Boolean | No usage cap |
usageLimit | Float | Maximum allowed usage |
currentUsage | Float | Current consumption |
resetPeriod | EntitlementResetPeriod | When usage resets |
usagePeriodStart | DateTime | Current period start |
usagePeriodEnd | DateTime | Current period end |
hasSoftLimit | Boolean | Soft vs hard limit |
accessDeniedReason | AccessDeniedReason | Why access was denied |
feature | EntitlementFeature | The feature details |
Access Denied Reasons
| Reason | Description |
|---|---|
NoActiveSubscription | No active subscription |
NoFeatureEntitlementInSubscription | Feature not in plan |
RequestedUsageExceedingLimit | Would exceed limit |
CustomerNotFound | Customer doesn’t exist |
FeatureNotFound | Feature doesn’t exist |
CustomerIsArchived | Customer is archived |
InsufficientCredits | Not enough credits |
Common Use Cases
Feature gating
Feature gating
Check access before showing/enabling a feature.
Usage checking
Usage checking
Verify if customer can perform an action based on usage limits.
Upgrade prompts
Upgrade prompts
Check limits to show upgrade prompts when approaching limits.
Example: Check Before Action
Related Operations
- Get Entitlements - Get all entitlements
- Entitlements State - Get entitlements with access state
- Report Usage - Report usage
