App Pricing Integration

Package for Shopify App Billing

A reusable Laravel package that handles plans, features and billing across Shopify app codebases. Simple drop-in integration, for powerful app pricing options.

My Shopify App Pricing package, showing plans in the Shopify App Store

Overview

I built a Laravel package that handles all of the business logic around plans, feature entitlements and billing for Shopify apps. It runs across multiple apps and connects directly to Shopify’s App Pricing, Partner and usage billing APIs. Each app gets the same plan selection, feature gating, usage billing and add-on purchasing, without writing any of it again.

When Mantle shut down, our first-party billing package lost the platform it was built on. I designed this package to replace it, and I made Shopify the commercial source of truth. Merchants pick and pay for plans through Shopify’s hosted pricing pages. The package turns that subscription into features, allowances and limits the app can act on, in the admin and on the storefront.

Key features

  • Hosted Shopify plan selection, with plans saved locally the moment a merchant subscribes
  • Features and per-plan entitlements set in one place for each app
  • Multiple feature types with typical on/off flags, allowance-based hard limits, and limits with chargeable overage
  • Laravel middleware to redirect shops without an active plan to Shopify’s pricing page
  • Usage-based overage billing through Shopify usage meters and Events API
  • Merchant-agreed spend caps, with a full audit trail and early warnings
  • Add-on credit packs, via an in-app “packs store” to allow flexibility
  • Per-shop overrides to support custom agreements
  • Real-time notifications for every billing event, to track upgrades, downgrades, cancellations and uninstalls

Problems solved

Mantle (the previous billing solution) shutting down left our live apps with no working billing platform. Rebuilding billing separately in each app would have been needlessly messy. The business needed one dependable way to charge for its apps: plans that paired from Shopify, features that switch on and off fore each of those plans, and new pricing models such as metered overage and credit packs that product teams could adopt without writing billing code.

Surprisingly (or not, if you’ve worked with Shopify!) Shopify’s own APIs for this are very limited. It can’t list an app’s plans, it accepts usage without confirming it was billed, and it has no usage caps.

I designed the package to make up for each of these gaps safely, and give us commercial freedom for how to charge for our apps.

Key features

Plans that come from Shopify

Plans are created and priced in the Shopify Partner Dashboard and nowhere else. When a merchant picks a plan, Shopify sends them back to the app where the package then reads the shop’s live subscription and ensures the app backend is in sync with this. This ensures that the merchant gets the features they need, immediately.

The package handles every lifecycle state: install, plan selection, upgrade, downgrade, cancelation etc.. A shop that cancels can keep using the app until its paid period ends, and a banner prompts it to renew or move to a lower plan. You can rank plans into tiers, so the business is told whether each plan change was an upgrade, a downgrade or a sideways move.

Feature definition and gating

Each app defines its features and maps them to Shopify plans in one consistent approach. A feature can be a simple on/off flag, a fixed limit, or a limit that can go over into paid usage. The package works out each shop’s effective entitlement in a fair way - regular plan allowance first, then any addon packs, then any usage-based additional charges.

The package provides SDK-like methods that allow the app to check whether a shop has a feature, or has enough allowance left, in a single line. This is available in both the app backend code, or in the frontend layers (storefront, admin & POS etc.).

Usage-based billing

When a feature goes past its allowance, the package can bill the extra usage through Shopify usage meters. Billing only happens when everything lines up: billing is switched on for the app, the plan includes a meter, the shop is out of trial, and someone at the store has agreed a spend cap. In every other case the feature acts as a hard limit, and the package still records the extra usage with the reason it wasn’t billed.

Shopify bills whatever it receives, so the package enforces the spend cap itself. Simultaneous requests can’t push spend past the cap, and every submission can be retried without double-billing. Each cap agreement is stored permanently, with the exact wording the merchant agreed to, the pricing at that moment and who agreed it. Merchants are warned as they approach their cap, and a cap pauses automatically if pricing changes underneath it.

Because Shopify accepts usage without confirming it was billed, a reconciliation job checks Shopify’s figures every hour. It flags anything dropped or mispriced and never resends. I also built in a shadow mode: usage is recorded exactly as it would be billed, but nothing is sent until the team is confident in the numbers.

Add-on credit packs

I included a method whereby an app can be configured to have extra allowance as addon packs. Merchants can buy extra allowance as one-off packs with a new screen in the Shopify admin screens of the app. Each pack has a price, a credit amount and an expiry period. It activates when Shopify confirms the payment and is used oldest-first after the plan allowance runs out.

Outcome

What started as a response to Mantle shutting down became a powerful, single billing setup for multiple production Shopify apps. Pricing changes happen in the Partner Dashboard, rather in application code. Feature gating works the same way across the admin, the storefront and checkout.

The package also made new pricing models available across the portfolio, including metered overage with spend caps and prepaid credit packs. The safeguards Shopify doesn’t provide, such as caps, reconciliation and alerting, are built in.

As a result, the Visualsoft Engineering teams spend less time maintaining billing code and can focus on the apps themselves.

Browse Other Shopify Apps

Got a project in mind?

If something here looks like what you need, I'd be happy to talk it through.

Contact me