Inputs
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
Name | Type | String |
---|---|---|
id | String! | The id which you want to assign to identify the user. |
billingId | String | The 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). |
name | String | The name of the user. |
String | The email of the user. | |
metadata | JSON | Attach 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
Name | Type | String |
---|---|---|
id | String! | The new id which you want to assign to identify the user. |
name | String | The name of the user. |
metadata | JSON | Attach any key-value data that would be useful to store on the User object. |
CreateUsageEventInput
Fields
Name | Type | String |
---|---|---|
userId | String! | The id of the user who used the feature. This maps to the id field as set on the User object. |
featureId | String! | The id of the feature which was used by the user. This maps to the id field as set on the Feature object. |
delta | Int | The 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 . |
action | RecordUsageAction | Specify 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
Name | Type | String |
---|---|---|
id | String! | The id which you want to assign to identify the feature. |
name | String | The name of the feature. |
type | FeatureType! | The type of the feature. Either BINARY or CONSUMABLE . |
unitLabel | String | The name of the consumable unit (eg. Message, API Call, etc). Only necessary if type is CONSUMABLE . |
unitLabelPlural | String | The pluralised name of the consumable unit (eg. Messages, API Calls, etc). Only necessary if type is CONSUMABLE . |
metadata | JSON | Attach 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
Name | Type | String |
---|---|---|
name | String | The name of the feature. |
unitLabel | String | The name of the consumable unit (eg. Message, API Call, etc). Only necessary if type is CONSUMABLE . |
unitLabelPlural | String | The pluralised name of the consumable unit (eg. Messages, API Calls, etc). Only necessary if type is CONSUMABLE . |
metadata | JSON | Attach 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
Name | Type | String |
---|---|---|
id | String! | The id which you want to assign to identify the package. |
name | String | The name of the package. |
isAddon | Boolean | Represents 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. |
metadata | JSON | Attach any key-value data that would be useful to store on the Package object. |
CreatePackageFeatureInput
Fields
Name | Type | String |
---|---|---|
id | String! | The id of theFeature which you want to add to the package. |
entitlement | EntitlementInput | The entitlement which a user would have for this consumable feature. Only necessary if the feature has a type of CONSUMABLE . |
EntitlementInput
Fields
Name | Type | String |
---|---|---|
limit | Int | Indicates the amount of the feature given to the user (ie. “500” ). If not provided, the amount will be unlimited. |
resetPeriod | ResetPeriod! | Indicates the period by which the limit will reset (ie. MONTH ). |
overageEnabled | Boolean | Flags 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
Name | Type | String |
---|---|---|
metadata | JSON | Attach any key-value data that would be useful to store on the Package object. |