Developer guide

The Shopify Billing API
Charge merchants correctly.

The Billing API is how Shopify apps charge merchants — without Stripe or your own payment processor. This guide covers the charge types, the confirmation flow, free trials, usage-based billing, and the mistakes that break monetization or fail App Store review.

12 min read · Updated June 2026

On this page (9)
  1. What the Billing API is
  2. Why you must use it
  3. The charge types
  4. The subscription flow
  5. Trials & annual billing
  6. Usage-based billing
  7. Common mistakes
  8. How AI builders wire it up
  9. FAQ

1. What the Billing API is

The Shopify Billing API is how apps charge merchants for using them. Rather than integrating your own payment processor and collecting card details, you create charges through Shopify's API. Shopify then bills the merchant on their regular Shopify invoice — alongside their Shopify subscription and other app charges — and pays you out on a regular schedule.

This is a significant convenience: you don't manage payment processing, PCI compliance, international payment methods, failed-card retries at the processor level, or invoicing. Shopify handles all of it. Your job is to tell the Billing API what to charge and when, and to react to the resulting status via webhooks.

For the merchant, paying for your app feels native — it's just another line on their Shopify bill, approved through Shopify's own interface. That native, low-friction purchase experience is part of why the Shopify App Store converts well compared to standalone SaaS.

The core idea

You don't collect money — Shopify does, on your behalf. You define charges (recurring, one-time, or usage-based) through the API; Shopify bills the merchant and pays you. This removes an enormous amount of payment infrastructure from your plate.

2. Why you must use it (not Stripe)

For apps on the public Shopify App Store, using the Billing API is mandatory. You cannot charge merchants with Stripe, PayPal, or any external processor for App Store app subscriptions. Shopify requires all such billing to flow through the Billing API, and review enforces this — an app that bills externally is rejected.

This trips up developers and generic AI tools coming from generic SaaS, where Stripe is the default. On Shopify, Stripe is the wrong choice for app billing. Generic AI builders generate Stripe integration because that's what their training data favors for SaaS — and the resulting app fails Shopify review for exactly this reason.

The revenue share

Shopify takes a share of revenue billed through the Billing API for App Store apps: 0% on your first $1,000,000 in lifetime app revenue, then 15% above that. This is the cost of the App Store's distribution and billing infrastructure. For apps distributed privately via custom distribution rather than the public App Store, there's no revenue share — you keep 100% while still using the Billing API to collect payment.

3. The charge types

The Billing API supports three models, each with its own GraphQL mutation:

Charge typeMutationUse for
Recurring subscriptionappSubscriptionCreateMonthly/annual plans
One-time chargeappPurchaseOneTimeCreateSetup fees, lifetime deals
Usage-basedusage records on a subscriptionPer-email, per-order, metered

The workhorse is appSubscriptionCreate, which creates a recurring (or usage-based) AppSubscription. A subscription contains one or more line items that define its pricing — a recurring fixed price, or a usage-based price with a capped amount, or both. This is how you model tiered plans and hybrid pricing.

Most apps use recurring subscriptions. One-time charges suit setup fees or lifetime deals. Usage-based suits apps where cost scales with volume (email, SMS). The models combine: a recurring base plan plus usage above an included allowance is a common, powerful structure.

4. The subscription flow step by step

Creating a charge isn't a single silent API call — it involves merchant approval. Here's the full flow:

  • 1. Create the subscription. When a merchant chooses a plan, your backend calls appSubscriptionCreate with the plan's pricing, interval, any trial days, and a return URL. The mutation returns a confirmation URL.
  • 2. Redirect the merchant. Send the merchant to the confirmation URL. Shopify shows them the charge details and asks them to approve or decline.
  • 3. Merchant approves. On approval, Shopify redirects back to your return URL and the subscription moves toward active (after any trial period).
  • 4. Handle the activation webhook. Shopify sends an app subscription update webhook confirming the status. Your app verifies the subscription is active before unlocking paid features.
  • 5. Bill on the interval. Shopify charges the merchant each billing cycle automatically and continues sending status webhooks for changes (cancellation, etc.).
Don't unlock features before activation

A common bug is unlocking paid features as soon as you create the subscription, before the merchant has actually approved the charge at the confirmation URL. Always confirm the subscription is active (via the return flow and the status webhook) before granting paid access. Otherwise merchants get paid features without an approved charge.

5. Free trials and annual billing

Free trials

When you create a recurring subscription, you can include a trial period (trial days). During the trial, the merchant isn't charged; billing begins automatically when the trial expires. If they cancel before the trial ends, they're never billed. This is handled by Shopify — you don't build trial timing logic yourself, you just specify the trial length. Free trials meaningfully increase conversion from install to paid, so most apps offer one (14 days is standard).

Annual billing

You can create subscriptions on a monthly or annual interval. Offering an annual plan at a discount (commonly ~2 months free) improves cash flow and dramatically reduces churn, since an annually-billed merchant is committed for the year. Shopify handles the annual billing cycle automatically. Offering both monthly and annual from launch is standard practice — see the pricing guide for how to structure this.

6. Usage-based billing

For apps where value scales with volume — emails sent, SMS messages, orders processed — usage-based billing charges merchants per unit consumed rather than a flat rate.

It works by creating a subscription with a usage-based line item that has a capped amount (the maximum a merchant can be charged in a billing period). As the merchant uses your app, you create usage records against the subscription, each adding a charge up to the cap. The cap protects merchants from surprise bills and is approved upfront, so you can charge usage without re-prompting for approval each time, as long as you stay under the cap.

Usage-based billing is more complex than flat recurring pricing — you track usage, create records, and handle approaching the cap — but it's the right model when your costs scale with usage. A common pattern is hybrid: a recurring base fee plus usage above an included allowance, giving you predictable base revenue and upside from heavy users.

7. Common Billing API mistakes

  • Using Stripe instead of the Billing API: the single most common monetization mistake on Shopify. External billing fails App Store review. Always use the Billing API for App Store apps.
  • Unlocking features before activation: granting paid access on subscription creation rather than after the merchant approves and the subscription is active.
  • Not handling the status webhook: failing to react to subscription update webhooks means you miss cancellations and downgrades, leaving features unlocked for merchants who stopped paying.
  • Listed pricing not matching API charges: your App Store listing prices must match what you actually create via the Billing API. Mismatches cause review issues and merchant confusion.
  • No usage cap: usage-based charges without a sensible cap risk surprising merchants with large bills, hurting trust and retention.
  • Mishandling plan changes: upgrades/downgrades require creating a new subscription and handling replacement of the old one cleanly. A broken upgrade flow loses you exactly the expansion revenue you want.

8. How AI builders wire up billing

The Billing API is one of the five requirements generic AI builders consistently get wrong. They generate Stripe integration — standard for generic SaaS — which doesn't work for Shopify App Store apps and fails review. Getting Shopify billing right means the correct mutation, the confirmation redirect, the activation webhook, and proper handling of trials, plan changes, and cancellations.

A Shopify-specific builder like Shopivibe generates the correct Billing API flow by default: appSubscriptionCreate with your plan structure, the confirmation URL redirect, the activation webhook handler, and trial support. When you describe a subscription app with tiered pricing, the right billing setup is generated — not Stripe, not a broken approximation.

You own the code and can adjust pricing, add usage-based components, or change tiers. But you start from a working, review-passing billing integration through Shopify's own system — which is the difference between an app that can actually charge merchants and one that fails review on monetization.

9. FAQ

What is the Shopify Billing API?
The Shopify Billing API is how apps charge merchants for using them. Instead of integrating your own payment processor, you create charges through Shopify's API and Shopify bills the merchant on their regular Shopify invoice, then pays you out. It supports recurring subscriptions, one-time charges, and usage-based billing. For App Store apps, all billing must go through this API.
Can I use Stripe to charge merchants for my Shopify app?
No — not for App Store apps. Shopify requires that apps charge merchants through the Shopify Billing API, not an external processor like Stripe. This is non-negotiable for App Store listing and is checked in review. Using Stripe for app subscription billing causes review rejection. The Billing API handles payment processing, so you don't need Stripe anyway.
How does the Shopify Billing API charge flow work?
You create a subscription with the appSubscriptionCreate GraphQL mutation, which returns a confirmation URL. You redirect the merchant to that URL where Shopify shows them the charge and they approve or decline it. On approval, the subscription becomes active (after any trial), and you receive a webhook confirming the status. You unlock paid features once the subscription is active.
Does the Shopify Billing API support free trials?
Yes. When creating a recurring subscription you can specify a trial period. During the trial the merchant isn't charged, and billing begins after the trial expires. If they cancel during the trial, they're never billed. Free trials significantly improve install-to-paid conversion and are supported natively — you don't build trial logic yourself.
What's the difference between recurring, one-time, and usage-based charges?
Recurring charges (appSubscriptionCreate) bill a fixed amount on an interval (monthly or annual) — the standard SaaS model. One-time charges (appPurchaseOneTimeCreate) bill once, useful for setup fees or lifetime deals. Usage-based charges bill per unit consumed (per email, per order) via usage records against a capped amount. Many apps combine a recurring base with usage-based components.
How much does Shopify take from app billing?
For App Store apps, Shopify takes 0% revenue share on your first $1,000,000 in lifetime app revenue, then 15% on revenue above that. For apps distributed privately via custom distribution rather than the public App Store, there is no revenue share — you keep 100%, while still using the Billing API to charge.
Do AI-built Shopify apps handle billing correctly?
A Shopify-specific builder like Shopivibe generates the correct Billing API flow — appSubscriptionCreate, the confirmation redirect, the activation webhook — by default. Generic AI tools generate Stripe integration, which doesn't work for App Store apps and fails review. The billing layer is one of the clearest cases where Shopify-grounded generation matters versus a generic web-app builder.
Get started

Build your own
Shopify app with AI

Describe the Shopify app you need — in plain language. Shopivibe handles everything Shopify requires and ships you a production-ready app. The code is yours to keep.

Start building free →
No developer neededLive app in minutesFull code ownership