Create time-based subscriptions
A time-based subscription is a pricing model that charges a consistent, recurring amount for a service. Shopify offers billing intervals for every 30 days and every 365 days.
Merchants must approve the pricing plan. After accepting the charges, the merchant is redirected to a URL that you provide.
Anchor to RequirementsRequirements
- Your app can make authenticated requests to the GraphQL Admin API.
Anchor to Step 1: Create the subscriptionStep 1: Create the subscription
-
Refer to an example of creating an app subscription.
-
Make a request to the
appSubscriptionCreate
mutation with the following information: -
Use the
appRecurringPricingDetails
field on the line item's plan to provide the following information:-
price
-
interval
NoteThe
interval
field acceptsANNUAL
orEVERY_30_DAYS
. If not provided, then the default ofEVERY_30_DAYS
is applied.
Anchor to Step 2: Monitor subscription updatesStep 2: Monitor subscription updates
To receive a notification when a subscription status changes, such as when a charge is successful, subscribe to the GraphQL Admin API's APP_SUBSCRIPTIONS_UPDATE
webhook topic.