Create recurring charges based on usage
You can use the appSubscriptionCreate
mutation to create a billing model that charges merchants based on the usage of your app. This billing model benefits both the merchant and you, because you have a constant stream of revenue, and the merchant will continue to get updates to the app that they subscribe to.
Create an app subscription
Anchor link to section titled "Create an app subscription"When you use the appSubscriptionCreate
mutation, you need to include the cappedAmount
field, which indicates the maximum amount of usage the merchant is billed for within the Shopify 30-day billing cycle. You also need to include the terms
field, which is reviewed by the merchant when they accept your pricing plan. The AppSubscription.id
and the AppSubscriptionLineItem.id
that are included in the payload are then used to create app usage records.
To create an app subscription based on usage, use the appSubscriptionCreate
mutation:
Create two pricing plans in one mutation
Anchor link to section titled "Create two pricing plans in one mutation"You can also create a recurring pricing plan and a usage pricing plan in a single mutation:
Create an app usage record
Anchor link to section titled "Create an app usage record"After you've created the usage pricing plan and the merchant has accepted the plan, you can create a usage record. The usage record needs to include the
AppSubscriptionLineItem.id
of the AppSubscription
object that is returned by the appSubscriptionCreate
mutation.
To create an app usage record, use the appUsageRecordCreate
mutation: