Billing for your app using the GraphQL Admin API

The GraphQL Admin API enables app developers to process charges through Shopify's merchant invoicing system. Using this functionality delivers the best merchant experience while greatly simplifying and streamlining billing for apps.

As an app developer, you select the API resource for your billing model and include the amount to charge. Shopify handles collecting the funds and making sure you get paid.

The Billing API is available for public apps. It can’t be used to charge merchants for custom or private apps.

There are three types of transactions between app developers and merchants:

  • AppPurchaseOneTime is used for items or services that are billed for only once. Each purchase needs to be approved by the merchant.
  • AppSubscription is used for items or services that are billed on a recurring basis. The subscription needs to be approved only once by the merchant, and any recurring charges are billed automatically. Usage records are billed with app subscriptions.
  • AppCredit is used to handle purchase adjustments. App credits are redeemed on future app purchases. Shopify deducts the purchase adjustment from your Partner account’s future payouts.

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 enter their credit card information to pay for apps.
  • Apps that use Shopify’s Billing API see higher free-to-paid conversion rates because charges 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.

Free testing for Shopify Partner development stores

Shopify Partners are more likely to recommend apps they’ve used before. Consider allowing free app testing in Shopify Partner development stores to help increase your app sales.

You can identify a development store by querying the Shop resource. Development stores return ( { "plan_name" : "affiliate" }). Once you've identified development stores, you can add logic to your app to avoid charging them. If you make your app free to affiliate stores, then contact us to get your app listed on our Partner-friendly app list.

How billing works with the GraphQL Admin API

Creating and issuing charges to users is a multiple-step process:

  1. A merchant initiates an action that includes a charge, such as app installation, service plan upgrade, or individual purchase.

  2. The app creates a charge for the merchant, which might be an app subscription or a one-time purchase.

  3. Shopify verifies the charge and returns a confirmationUrl where the merchant is redirected to accept or decline the charge.

  4. When the merchant accepts the charge, they are redirected to the returnUrl specified by your app when it issued the charge.

  5. If the charge is declined, then Shopify redirects the merchant to Shopify admin, and provides a notification message that the app charge was declined.

Webhooks for billing

You can use the webhookSubscriptionCreate mutation to register webhooks for specific shop events. For billing, the following webhook topics are available:

Next Steps

Sign up for a Partner account to get started.

Sign up