Billing for your app with the REST Admin API
The REST Admin API provides an integrated billing solution that allows app charges to be handled by Shopify's merchant invoicing system.
This guide provides an introduction to the REST Admin API resources related to billing and illustrates the workflow for creating and issuing charges.
API resources
Anchor link to section titled "API resources"The following REST Admin API resources are available to help you meet the needs of your specific billing model:
- ApplicationCharge: Used to bill merchants one time only (for example, when their free trial expires). This type of charge is recommended for apps that aren’t billed on a recurring basis.
- RecurringApplicationCharge: Used to bill merchants on a recurring 30-day billing cycle.
- UsageCharge: Used to charge merchants when fees are recurring, but vary from month to month.
You can select the API resources for your billing model and include the amount to charge. Shopify handles charging the merchant and making sure you get paid.
How it works
Anchor link to section titled "How it works"The following diagram illustrates the workflow for creating and issuing charges:
A merchant triggers a charge with an event that you've identified, such as app installation, service plan upgrade, or individual purchase.
The app creates a charge for the merchant, which might be arecurringorone-time charge.
Shopify verifies the charge and returns a
confirmation_url
that redirects the merchant to accept or decline the charge.If the merchant accepts the charge, then they're redirected to the
return_url
specified when issuing the charge. The charge immediately transitions frompending
toactive
. After the charge is activated (the charge is in anactive
state), you get paid.If the charge is declined, then Shopify redirects the merchant and provides a notification message that the app charge was declined.
Considerations
Anchor link to section titled "Considerations"Shopify Partners are more likely to recommend apps they've used before. Consider offering free app testing ondevelopment storesto help increase your app sales.
Learn how tooffer free testing for development stores.
In this section
Anchor link to section titled "In this section"Billing concepts— Learn about the different methods of billing to help you choose the one that's best for your app.
Determine your billing model— Determine which billing model is best for your app using the REST Admin API.
Implement your billing model-了解to implement the billing model for your app with the REST Admin API.
Free trials— Encourage merchants to try your app by offering a free trial with the REST Admin API.
Refund an app payment— Respond to refund requests from merchants who use your app using the REST Admin API.
Upgrades and downgrades-了解to upgrade and downgrade a merchant's app subscription using the REST Admin API.
Charging for your app with the REST Admin API: FAQ— Frequently asked questions about charging money for your app with the REST Admin API.