They contain fields. Each field has its own type, which could be Scalars, Enums, or other objects. Fields may have arguments. Fields with arguments work exactly like top-level Queries.

Feature

A feature of your product which you could consider to be billable. Features can be added to packages.

How can I see the limit given to a feature?

A feature does not have a global limit. Limits are given to features within packages (ie. a PackageFeature) as each package can have a different limit for a particular feature. You will need to retrieve the package in order to grab the feature as it exists within a package to see the limit.

Fields

NameTypeDescription
idString!The id of the feature which is provided by you.
nameString!The name of the feature.
typeFeatureType!The type of the feature. Either BINARY or CONSUMABLE.
unitLabelStringThe name of the consumable unit (eg. Message, API Call, etc). Only present if type is CONSUMABLE.
unitLabelPluralStringThe pluralised name of the consumable unit (eg. Messages, API Calls, etc). Only present if type is CONSUMABLE.
metadataJSONA set of key-value data which was attached by yourself to this object (ie. often additional data deemed useful to store).
packages[Package!]!A list of the packages which are associated with the feature.

Fields with arguments

NameArgumentArgument TypeReturn TypeDescription
entitlementuserIdString!EntitlementA user’s entitlement to the feature.

What if a user is subscribed to multiple packages with the same feature?

If the user is subscribed to multiple packages which contain the same feature, then we will look for the associated Package with the highest limit and will only return the Entitlement for that package/feature combination.

Package

A collection of features. A user can subscribe to packages in order to gain access to the features within. This can be a base package, or an add-on (ie. those at an additional cost on top of the base).

Fields

NameTypeDescription
idString!The id of the package which is provided by you.
nameString!The name of the package.
isAddonBoolean!Represents whether the package is an add-on (true) or a base package (false).
statusPackageStatus!Represents whether the package is a DRAFT, ARCHIVED or PUBLISHED.
updatedAtDateTime!When the package was last updated.
features[PackageFeature!]!A list of the features within the package.
prices[PackagePrice!]!A list of prices which relate to this package.

PackageFeature

The feature as it sits within the package.

Fields

NameTypeDescription
idString!The id of the Feature.
nameString!The name of the feature within the package. This can be different than the feature it relates to.
typeFeatureType!The type of the feature. Either BINARY or CONSUMABLE.
limitIntIndicates the amount of the feature given in the package (ie. “500”). Only present if type is CONSUMABLE.
unitLabelStringThe name of the consumable unit for the feature (eg. Message, API Call, etc). Only present if type is CONSUMABLE.
unitLabelPluralStringThe pluralised name of the consumable unit for the feature (eg. Messages, API Calls, etc). Only present if type is CONSUMABLE.
metadataJSONA set of key-value data which was attached by yourself to the respective feature object (ie. often additional data deemed useful to store).

PackagePrice

An available price for the package which links to your billing provider (ie. Stripe).

Fields

NameTypeString
idString!The id of the price as given by your billing provider (ie. price_1L7NHvIiEnRX8aivoxbSWREF).
providerString!The billing provider to which this price belongs.
amountInt!The amount which users will be charged.
displayAmountString!A read-friendly version of the amount.
currencyString!The currency of the amount which will be charged.
intervalString!The frequency at which someone will be charged this price.

Entitlement

A user’s entitlement to a particular feature.

Fields

NameTypeDescription
accessBoolean!Specifies whether the user has access (true) or not (false) to the feature.
reasonString!The reason why the user either has access to the feature or not.
consumptionConsumptionThe amount of the feature which the user has used, their overall allowance (budget), and if they can go over that allowance.

Consumption

A user’s consumption of a particular feature. Details the amount they have used, the amount they were granted, and if they can run over the given amount of the feature.

Fields

NameTypeDescription
usedInt!The amount of the feature which has been used by the user.
budgetIntThe amount of the feature which has been granted to the user. Will return null if unlimited.
overageEnabledBoolean!Flags whether a user can run over the amount of the feature (true) or if there is a hard limit that should prevent usage (false).

ConsumptionInPeriod

Shows the consumption of a feature within a given time period.

Fields

NameTypeDescription
periodStartDateTime!The start of the usage period in ISO 8601 timestamp format.
periodEndDateTime!The end of the usage period in ISO 8601 timestamp format.
consumptionString!The consumption of the feature within the given time period.

PackageSubscription

The subscription of a user to a particular package.

Fields

NameTypeDescription
idString!A Kana-generated identifier for the subscription.
userIdString!The id of the user.
statusSubscriptionStatus!The status of the subscription of the user to the package. Either ACTIVE or CANCELLED.
packagePackage!The package which is associated to the subscription.

CanUseFeatureData

A user’s entitlement to a particular feature.

Fields

NameTypeDescription
accessBoolean!Specifies whether the user has access (true) or not (false) to the feature.
reasonString!The amount of the feature which the user has used, their overall allowance (budget), and if they can go over that allowance.
consumptionConsumptionThe amount of the feature which the user has used, their overall allowance (budget), and if they can go over that allowance.

ShowUsageData

Provides the current and past consumption of a feature within the given time period(s).

Fields

NameTypeDescription
currentConsumptionInPeriodThe consumption a the feature in the current period of usage.
past[ConsumptionInPeriod!]A list detailing the previous consumption of a feature within the given periods of usage.

Provides a link which a user should navigate to in order to pay and subscribe to a package.

Currently only works if Stripe is linked as a billing provider for the package.

Fields

NameTypeDescription
urlString!The generated URL for a user to navigate to and pay to subscribe to a package.

User

A user of your product who can subscribe to packages and access and use the features within.

Fields

NameTypeDescription
idString!The id of the user which is provided by you.
billingIdStringThe id of the user as given by your billing provider (ie. cus_Lp1bSKob4laHDD).
nameStringThe name of the user.
emailStringThe email of the user.
metadataJSONA set of key-value data which was attached by yourself to this object (ie. often additional data deemed useful to store).

RecordedUsage

Information returned on whether usage was recorded or not (as per the recordUsage operation).

Fields

NameTypeDescription
recordedBoolean!Specifies whether the usage of the feature was recorded (true) or not (false).
reasonStringThe reason why the usage of the feature was either recorded or not.

GeneratedUserToken

The client-side token needed for Secure Mode authentication of the Client SDK (Frontend).

Fields

NameTypeDescription
tokenStringThe generated token which is scoped to the user.