App subscription
App monetization utilizes subscriptions as a billing contract between a user and an app. Each subscription contains unique data about the user’s billing frequency, plan type, and renewal period.
Queries
You can use the app_subscription query to retrieve app subscription data via the API.
- Returns an array containing the current app and account subscription details based on the token used
- If an account has a mock subscription and a real one, it will only return the mock subscription
- Can only be queried directly at the root; can’t be nested within another query
This query is called on the app-level. It can only be called within the context of an app, not from the API Playground.
It only returns details based on the token used. If you want to query all of your app’s subscriptions, use the app_subscriptions object instead.
Fields
You can use the following fields to specify what information your app_subscription query will return.
Mutations
Set mock app subscription
The set_mock_app_subscription mutation creates a mock subscription for an account and app based on the token you’re using. You can specify which fields to return in the mutation response.
Mock subscriptions disappear after 24 hours, and each account-app pair can create one mock subscription. You may need to refresh your browser after creating a mock subscription so that it shows in your account.
Arguments
You can use the following arguments to define the mock app subscription.
Remove mock app subscription
The remove_mock_app_subscription mutation removes the mock subscription for the current account. You can specify which fields to return in the mutation response.
Arguments
You can use the following arguments to specify which mock app subscription to remove.