mutation before the field(s).
Query Variables
We use variables throughout our example requests. We do this in order to mirror real-world application practices whereby you would most likely want dynamic values for your arguments. Take a look at this guide if you’re unfamiliar with how variables work in GraphQL.createFeature
Create a Feature.Arguments
Return Fields
Examples
updateFeature
Update a Feature.Arguments
Return Fields
Examples
createPackage
Create a Package.Package StatusYour package will always have a status of DRAFT upon being created. If you want to publish this package then you will have to do so through the Dashboard.
Arguments
Return Fields
Examples
updatePackage
Update a Package.Arguments
Return Fields
Examples
createUser
Create a User.Arguments
Return Fields
Examples
updateUser
Update a User.How can I update the email or billingId of a user?You will need to do this through a CSV Import within our Dashboard. We’ll soon make this possible through the API.
Arguments
Return Fields
Examples
subscribe
Subscribe a User to a Package - either one or multiple. Returns a PackageSubscription. Users can only be subscribed to a Package with a status ofPUBLISHED.
Arguments
Return Fields
Examples
Errors
Cannot subscribe to addon
Cannot subscribe to addon
Cannot subscribe to multiple tiers
Cannot subscribe to multiple tiers
Why?
A user is being subscribed to multiple base plans (ie. tiers) within the mutation, or is already subscribed to a base plan.Solution
Ensure there’s only one base plan in the mutation, or check that the user is not already subscribed to a base plan with the subscription query. TheisAddon field for the Package object will be false if it’s a base plan. You can check Packages with the packages query.Example
Package Id not found for app
Package Id not found for app
recordUsage
Records the usage of a Feature by a User, including the amount it was used by.Revert UsageIf you want to revert usage by a certain amount (ie. subtract rather than add from the usage of a feature), you can do so by providing a negative amount in the
delta argument (ie. -1).Arguments
Return Fields
Examples
generateSubscriptionLinks
Generate a payment link which a user can navigate to in order to pay and subscribe to a Package.Upon successful payment, we will automatically receive notification of the
user and the packages they have subscribed to in order to create
PackageSubscriptions.
You do not need to notify Kana (ie. through the
subscribe
mutation) yourself.