Charging for your app with the REST Admin API: Introduction
Shopify’s Billing API provides an integrated billing solution that enables app charges to be handled by Shopify's merchant invoicing system. Leveraging this functionality provides the best merchant experience while greatly simplifying and streamlining billing for your apps. You 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.
The Billing API includes three API resources to help meet the needs of your specific billing model:
- ApplicationCharge is used to bill your users 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 is used to bill your users on a recurring 30-day billing cycle.
- UsageCharge – is used to charge merchants when fees are recurring, but vary from month to month.
There are several advantages to using Shopify's Billing API:
- The charges appear directly on the merchant’s Shopify invoice – merchants don't have to input their credit card information to pay for your app.
- Apps that use Shopify’s Billing API see higher free-to-paid conversion rates because charges appear to originate directly from Shopify.
- The correct amount of tax is charged automatically.
- You automatically receive a revenue share from Shopify. Your share of the revenue is defined in the Shopify Partner revenue share agreement.
- Shopify handles all chargebacks.
How it works
Creating and issuing charges to users is a multi-step process:
A merchant triggers a charge with an event that you've identified, such as app installation, service plan upgrade, or individual purchase.
Shopify verifies the charge and returns a
confirmation_urlthat redirects the merchant to accept or decline the charge.
When the merchant accepts the charge they are redirected to the
return_urlspecified when issuing the charge. The
If the merchant accepts, then the app uses the
charge_idto activate the charge. If the charge is declined, then Shopify redirects the merchant and provides a notification message that the app charge was declined.
After the charge is activated, you'll get paid. If you do not activate a RecurringApplicationCharge, then the merchant is not charged and you are not paid. If you do not activate an ApplicationCharge, then the merchant is charged when accepting, but you are not paid.
For more information on how the Billing API works, see Billing concepts.
More about billing for apps with the REST Admin API
These guides aim to help you get the most from your experience developing on Shopify's Billing API.
Determine your billing model – This guide introduces you to each of the Billing API's endpoints to understand how the APIs can best suit your billing model.
Implement your billing model – Once you've familiarized yourself with the Billing API resources, dive into this detailed implementation guide.
Upgrading and downgrading – This guide covers upgrading or downgrading a merchant's plan.
Free trials – Follow this guide to learn the best way to manage free trials for your app.
Re-installs - Follow this guide to learn how to gracefully handle billing for re-installed apps.