Query
query EntitlementsState($query: FetchEntitlementsQuery!) {
entitlementsState(query: $query) {
accessDeniedReason
entitlements {
accessDeniedReason
creditRate {
amount
costFormula
currencyId
customCurrencyId
}
currentUsage
customerId
displayNameOverride
entitlementUpdatedAt
}
entitlementsUpdatedAt
entitlementsV2 {
__typename
... on CreditEntitlement {
accessDeniedReason
currency {
__typename
}
currentUsage
entitlementUpdatedAt
hasSoftLimit
isGranted
}
}
}
}Variables
{
"query": {
"customerId": "string"
}
}Response
{
"data": {
"entitlementsState": {
"accessDeniedReason": "CustomerIsArchived",
"entitlements": [
{
"accessDeniedReason": "BudgetExceeded",
"creditRate": {
"amount": 1.5,
"costFormula": "string",
"currencyId": "string",
"customCurrencyId": "value"
},
"currentUsage": 1.5,
"customerId": "string",
"displayNameOverride": "string",
"entitlementUpdatedAt": "value"
}
],
"entitlementsUpdatedAt": "value",
"entitlementsV2": [
{
"__typename": "CreditEntitlement",
"accessDeniedReason": "BudgetExceeded",
"currency": {
"__typename": "EntitlementCurrency"
},
"currentUsage": 1.5,
"entitlementUpdatedAt": "value",
"hasSoftLimit": true,
"isGranted": true
}
]
}
}
}Queries
entitlementsState
Retrieve entitlements from the cache to optimize performance, together with an access denied reason.
QUERY
entitlementsState(query: FetchEntitlementsQuery!): EntitlementsState!Arguments
query
required
Query for retrieving all entitlements for a customer in a specific environment.
Returns
accessDeniedReason
Optional message explaining why access to the feature is denied.
entitlements
[Entitlement!]!
deprecated
The list of feature entitlements granted to the customer.
Use 'entitlementsV2' field instead to retrieve both feature and credit entitlements.
entitlementsUpdatedAt
DateTime!
When these entitlements last changed. The latest of the entitlement, customer and subscription update times; always set, also when the list is empty.
entitlementsV2
[EntitlementUnion!]!
The list of polymorphic entitlements (feature and credit) granted to the customer.
Query
query EntitlementsState($query: FetchEntitlementsQuery!) {
entitlementsState(query: $query) {
accessDeniedReason
entitlements {
accessDeniedReason
creditRate {
amount
costFormula
currencyId
customCurrencyId
}
currentUsage
customerId
displayNameOverride
entitlementUpdatedAt
}
entitlementsUpdatedAt
entitlementsV2 {
__typename
... on CreditEntitlement {
accessDeniedReason
currency {
__typename
}
currentUsage
entitlementUpdatedAt
hasSoftLimit
isGranted
}
}
}
}Variables
{
"query": {
"customerId": "string"
}
}Response
{
"data": {
"entitlementsState": {
"accessDeniedReason": "CustomerIsArchived",
"entitlements": [
{
"accessDeniedReason": "BudgetExceeded",
"creditRate": {
"amount": 1.5,
"costFormula": "string",
"currencyId": "string",
"customCurrencyId": "value"
},
"currentUsage": 1.5,
"customerId": "string",
"displayNameOverride": "string",
"entitlementUpdatedAt": "value"
}
],
"entitlementsUpdatedAt": "value",
"entitlementsV2": [
{
"__typename": "CreditEntitlement",
"accessDeniedReason": "BudgetExceeded",
"currency": {
"__typename": "EntitlementCurrency"
},
"currentUsage": 1.5,
"entitlementUpdatedAt": "value",
"hasSoftLimit": true,
"isGranted": true
}
]
}
}
}