Setup usage charges
Usage-based pricing lets you charge merchants based on their actual usage of your app's features. This pricing model is ideal for apps where costs scale with usage, such as messaging apps, email marketing tools, or apps that process transactions.
Usage-based pricing accounts for over 60% of revenue from top-earning apps on the Shopify App Store.
Anchor to When to use usage-based pricingWhen to use usage-based pricing
Consider usage-based pricing if your app:
- Sends messages or emails: Charge per SMS sent, email delivered, or notification pushed
- Processes transactions: Charge based on order volume, revenue generated, or items sold
- Uses external APIs: Pass through costs for third-party services like shipping carriers or payment processors
- Provides compute-intensive features: Charge for AI processing, image optimization, or data analysis
- Offers variable-value features: Align costs with the value merchants receive
Anchor to Pricing structuresPricing structures
You can choose from three usage-based pricing structures:
Anchor to Fixed pricingFixed pricing
Charge a uniform price for each billing event. For example, charge $0.01 per SMS sent or $0.50 per order processed.
Anchor to Graduated pricingGraduated pricing
Price tiers based on cumulative usage. As merchants use more, they pay different rates for usage in each tier. The final charge is the sum of all tiers.
For example, with tiers set as:
- 1-100 units at $10 per unit
- 101-200 units at $9 per unit
- 201+ units at $8 per unit
If a merchant uses 150 units, they pay: (100 × $10) + (50 × $9) = $1,450
Anchor to Volume pricingVolume pricing
Price tiers based on total usage volume. The rate for the entire quantity is determined by which tier the total usage falls into.
For example, with the same tier structure:
- 1-100 units at $10 per unit
- 101-200 units at $9 per unit
- 201+ units at $8 per unit
If a merchant uses 150 units, they pay: 150 × $9 = $1,350 (using the 101-200 tier rate)
Anchor to How usage-based pricing worksHow usage-based pricing works
Usage-based pricing requires you to configure meters in the Partner Dashboard and then send billing events to Shopify using the App Events API.
Anchor to Step 1: Configure meters in the Partner DashboardStep 1: Configure meters in the Partner Dashboard
In your app's submission page, define the usage meters you want to track:
- Navigate to your app in the Partner Dashboard
- Go to the Pricing section
- Create a usage meter and give it an
event_handle(for example,sms_sent,email_delivered,order_processed) - Configure your pricing structure (fixed, graduated, or volume) for each meter
- Set your pricing tiers and rates
You can create up to five usage meters per plan to track different types of usage.
Whether a meter tracks whole units (such as messages or orders) or fractional units (such as gigabytes or compute hours) is set by the value you send in each event, not by a separate meter option. Send whole units as integers, and fractional units as decimal amounts in a quoted string. See Understand the request fields for the exact format.
Anchor to Step 2: Send events using the App Events APIStep 2: Send events using the App Events API
Once your meters are configured, use the App Events API to send billing events to Shopify as they occur in your app. The event_handle in each request must match the meter handle you defined in the Partner Dashboard.
The event_handle must match the meter handle you configured in the Partner Dashboard. The value in the attributes object is a non-zero quantity of usage. For details see Understand the request fields. Idempotency is enforced permanently for billing events, always use a new idempotency_key for each distinct charge or reversal.
Don't include any data that, alone or in combination with other data, could identify an individual. This includes any merchant or buyer information, such as name, email address, phone number, and other identifiable data points. Use anonymized identifiers and aggregated metrics instead.
Don't include any data that, alone or in combination with other data, could identify an individual. This includes any merchant or buyer information, such as name, email address, phone number, and other identifiable data points. Use anonymized identifiers and aggregated metrics instead.
For detailed implementation instructions, see Build a billing event.
Anchor to Step 3: Validate events in the Dev DashboardStep 3: Validate events in the Dev Dashboard
After sending events, verify they're being received and classified correctly in the Dev Dashboard:
- Open the Dev Dashboard and navigate to your app
- Go to the Logs section
- Under the Type filter, select App billing event to see only events tied to your pricing meters
- Verify that each event's status is
OK
The status of a billing event is OK when Shopify recorded the usage. Otherwise, the status is the event's billing result code.
If an event isn't listed as an App billing event, then the event_handle in your API request doesn't match any meter handle configured in the Partner Dashboard Pricing section. Shopify records a billing result only for events that match a meter. An event that matches no meter isn't billed and is listed only as an App event. The handle must match exactly between your App Events API request and your pricing configuration. If an event fails validation, review the error details and update your implementation accordingly.
The Dev Dashboard is the only place to see billing errors for your events. The App Events API returns a 202 response when it accepts your request, even if the event later fails billing validation. There is no synchronous billing error response and no webhooks for billing validation failures.
The Dev Dashboard is the only place to see billing errors for your events. The App Events API returns a 202 response when it accepts your request, even if the event later fails billing validation. There is no synchronous billing error response and no webhooks for billing validation failures.
Anchor to Billing error statesBilling error states
The following billing result codes can appear in the Dev Dashboard when Shopify can't record usage for an event. The event isn't billed. For solutions, refer to Troubleshoot billing errors.
| Error | Description |
|---|---|
INVALID_VALUE | The value in the attributes is zero or isn't a valid number. Use a non-zero number: send a negative value to reverse usage, and send fractional values as a quoted string, such as "1.5". Unquoted floating-point numbers are rejected. Values can have at most 6 decimal places and at most 15 digits before the decimal point. |
MISSING_VALUE_KEY | The value key is missing from the attributes. |
INVALID_ACCOUNT | Shopify couldn't find the store in shop_id, or the store doesn't have a billing account. |
NO_SUBSCRIPTION | The store doesn't have a subscription to your app, or the subscription isn't active. |
INVALID_SUBSCRIPTION | The store's subscription to your app was created with the Billing API, not Shopify App Pricing. |
SUBSCRIPTION_NOT_METERED | The merchant's subscription doesn't include usage-based pricing. |
NO_MATCHING_METER | The merchant's subscription includes usage meters, but none of them matches the event's event_handle. |
PERIOD_CLOSED | The event's timestamp is outside the merchant's current billing cycle, or the merchant's subscription is in a free trial. Learn more about usage and billing cycles. |
INTERNAL_ERROR | Shopify couldn't process the event because of a problem on Shopify's side. Don't resend the event, including with a new idempotency key. Contact Shopify Partner Support and include the event's idempotency key. |
Shopify enables some of these checks gradually, so you might not see every code for your app. Idempotency key problems aren't billing result codes: the App Events API rejects a missing or too-long idempotency_key when you send the request.
Anchor to Step 4: Automated billingStep 4: Automated billing
Once events are validated and accepted, Shopify automatically:
- Aggregates usage for each merchant based on your configured meters
- Applies your pricing structure (fixed, graduated, or volume)
- Adds the calculated charges to the merchant's monthly bill
After a merchant uninstalls your app, you have a limited time to send billing events for usage that occurred before the uninstall. Learn how long in Usage after a merchant uninstalls your app.
After a merchant uninstalls your app, you have a limited time to send billing events for usage that occurred before the uninstall. Learn how long in Usage after a merchant uninstalls your app.
Anchor to Usage and billing cyclesUsage and billing cycles
Shopify bills a usage event only when its timestamp falls inside the merchant's current billing cycle. Shopify doesn't bill an event outside the current cycle, and the event's billing result code is PERIOD_CLOSED. This rule decides how usage behaves during a free trial, when a merchant changes plans, and when you correct usage.
Anchor to Usage during a free trialUsage during a free trial
A subscription has no billing cycle while its free trial runs. The first billing cycle starts when the trial ends. So Shopify doesn't bill usage events that you send during a trial, and each one gets PERIOD_CLOSED.
Shopify doesn't hold trial usage for the first paid cycle. After the trial ends, an event with a timestamp inside the trial still gets PERIOD_CLOSED, so you can't send trial usage again to bill it later. Billing for usage starts with the first paid billing cycle.
During a trial, the Partner API activeSubscription query returns trialEndsAt and a null currentBillingCycle. After the trial ends, it returns the dates of the first billing cycle in currentBillingCycle.
Anchor to Usage when a merchant changes plansUsage when a merchant changes plans
When a plan change takes effect right away, Shopify bills the usage that you reported for the current billing cycle, at the current plan's rates. A new billing cycle starts on the day of the change, and later usage counts toward the new plan's meters.
If the merchant has trial days left on the new plan, then the new plan starts with a free trial instead of a billing cycle. Usage during that trial gets PERIOD_CLOSED, as described in Usage during a free trial. The first billing cycle starts when the trial ends. Learn how trial days carry over in Trial proration.
After the change, an event with a timestamp before the change is outside the new billing cycle, so it gets PERIOD_CLOSED. Shopify processes billing events asynchronously, and it compares the timestamp with the billing cycle when it processes the event, not when you send it. So an event that you send just before a plan change can still get PERIOD_CLOSED. Send each billing event as soon as the usage happens, so that Shopify can bill it before a plan change.
When a plan change waits for the end of the billing cycle, the current plan's meters and rates apply until the cycle ends. Shopify bills that cycle's usage as usual.
Anchor to Corrections and closed billing cyclesCorrections and closed billing cycles
You can correct usage only inside the current billing cycle. To correct usage, send a correction event with a negative value and a timestamp inside the current cycle.
After a billing cycle ends, Shopify bills its usage. A correction with a timestamp in an earlier cycle gets PERIOD_CLOSED.
Anchor to Usage after a merchant uninstalls your appUsage after a merchant uninstalls your app
After a merchant uninstalls your app, you have 24 hours to send remaining usage and corrections for usage that occurred before the uninstall, or until the current billing cycle ends if that's sooner:
- After the billing cycle ends, Shopify bills the cycle, and later events get
NO_SUBSCRIPTION. - After 24 hours, the App Events API rejects each request with a
403response and thenot_installederror code. Shopify doesn't record the event, so it gets no billing result.
Make sure your app sends any pending billing events promptly when you receive an app uninstalled webhook.
Anchor to Combining pricing modelsCombining pricing models
You can combine recurring charges with usage-based pricing to create hybrid pricing plans:
- Base fee + usage: Charge a monthly subscription fee plus usage-based charges (for example, $29/month + $0.01 per SMS)
- Usage only: Uncheck the subscription fee and charge only for usage
- Tiered plans with usage: Offer different base tiers with varying usage rates or included usage allowances
You can't currently combine usage-based pricing with yearly-only plans. Usage charges must be tied to a monthly billing cycle.
Learn more about combining time and usage.
Anchor to LimitationsLimitations
Usage-based pricing has the following limitations:
- You can create up to five active usage meters per plan
- You can define up to six pricing tiers per usage meter
- Usage charges must be billed monthly (can't be combined with yearly-only plans)
- Usage caps aren't currently supported
- You have a limited time to send billing events after a merchant uninstalls your app. Learn more about usage after a merchant uninstalls your app.
Anchor to Next stepsNext steps
- Build a billing event to start sending usage data
- Explore the App Events API reference for implementation details
- Learn about time-based subscriptions
- Combine time and usage for hybrid pricing
- Offer free trials to increase conversions