Inputs are used as arguments for your mutation operations. They are a type of object which define a set of fields, which in turn can either be Scalars, Enums, or other input objects.

CreateUserInput

Fields

NameTypeString
idString!The id which you want to assign to identify the user.
billingIdStringThe id of the user which identifies them to be charged for their subscriptions. This will often be the id given by your payment provider (ie. Stripe, Chargebee, etc).
nameStringThe name of the user.
emailStringThe email of the user.
metadataJSONAttach any key-value data that would be useful to store on the User object.

UpdateUserInput

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.

Fields

NameTypeString
idString!The new id which you want to assign to identify the user.
nameStringThe name of the user.
metadataJSONAttach any key-value data that would be useful to store on the User object.

CreateUsageEventInput

Fields

NameTypeString
userIdString!The id of the user who used the feature. This maps to the id field as set on the User object.
featureIdString!The id of the feature which was used by the user. This maps to the id field as set on the Feature object.
deltaIntThe amount by which the feature was used. This will impact the Entitlement a user has for a feature, by updating the used field in the Consumptionmodel. Defaults to 1.
actionRecordUsageActionSpecify how you want the usage of the feature to be recorded. Can be ADD (to add to existing usage amount) or SET (to override the existing usage amount). Defaults to ADD.

CreateFeatureInput

Fields

NameTypeString
idString!The id which you want to assign to identify the feature.
nameStringThe 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 necessary if type is CONSUMABLE.
unitLabelPluralStringThe pluralised name of the consumable unit (eg. Messages, API Calls, etc). Only necessary if type is CONSUMABLE.
metadataJSONAttach any key-value data that would be useful to store on the Feature object.

UpdateFeatureInput

How do I update the type of feature?

It is not possible to update the type of feature once it has been initially set. You would need to create a new feature altogether.

Fields

NameTypeString
nameStringThe name of the feature.
unitLabelStringThe name of the consumable unit (eg. Message, API Call, etc). Only necessary if type is CONSUMABLE.
unitLabelPluralStringThe pluralised name of the consumable unit (eg. Messages, API Calls, etc). Only necessary if type is CONSUMABLE.
metadataJSONAttach any key-value data that would be useful to store on the Feature object.

CreatePackageInput

How do I add prices to my packages and/or features within?

You will currently need to use the Dashboard to add any billing templates and prices to packages and respective features within. We are currently looking into how to best achieve this through the API.

Fields

NameTypeString
idString!The id which you want to assign to identify the package.
nameStringThe name of the package.
isAddonBooleanRepresents whether the package is an add-on (true) or a base package (false). Defaults to false.
features[CreatePackageFeatureInput!]!A list of the features which will be added to the package.
metadataJSONAttach any key-value data that would be useful to store on the Package object.

CreatePackageFeatureInput

Fields

NameTypeString
idString!The id of theFeature which you want to add to the package.
entitlementEntitlementInputThe entitlement which a user would have for this consumable feature. Only necessary if the feature has a type of CONSUMABLE.

EntitlementInput

Fields

NameTypeString
limitIntIndicates the amount of the feature given to the user (ie. “500”). If not provided, the amount will be unlimited.
resetPeriodResetPeriod!Indicates the period by which the limit will reset (ie. MONTH).
overageEnabledBooleanFlags whether a user can run over the limit (true) or if it should be a hard limit that prevents usage (false). Defaults to false.

UpdatePackageInput

For larger changes beyond adding metadata, you should use the Dashboard to update existing packages. We are currently looking into how to best achieve this through the API.

Fields

NameTypeString
metadataJSONAttach any key-value data that would be useful to store on the Package object.