Usage-based billing
Usage-based billing (also known as metered billing or consumption billing) is a common pricing model for SaaS businesses that enables you to charge based on a customer’s usage of your product or service. As a business, you provide access to your service and bill your customer based on their usage. With Stripe Billing, you can set up and integrate different types of usage-based pricing models with your SaaS product.
Interested in our new usage-based billing API?
Thank you! We'll be in touch soon.
Getting started
Usage-based billing lifecycle
Here’s what the lifecycle of a usage-based billing looks like.
This diagram illustrates what happens after you’ve implemented a customer experience.
Sample integration
This example walks through the implementation of a fictional font service called Typographic.
Create a product and pricing
Model your business on stripe with products and prices.
Create your products and their pricing options with the Stripe API or Dashboard. Typographic has three products, each with two tiers:
- Standard
- Tier one: 10 USD per month for 10,000 requests
- Tier two: An additional $0.10 USD for each request after 10,000
- Growth
- Tier one: 25 USD per month for 10,000 requests
- Tier two: An additional $0.10 USD for each request after 10,000
- Enterprise
- Tier one: 75 USD per month for 10,000 requests
- Tier two: An additional $0.0075 USD for each request after 10,000
To achieve this kind of pricing, you charge a flat fee and an additional amount based on how much customers use. With graduated tiers, customers initially pay the flat fee for the first 10,000 requests. If they make more requests than that, they reach tier two and start paying for each additional request. You could also charge solely based on usage without the flat fee.
During each billing period, you create usage records for each customer and then Stripe adds them up to determine how much to bill for. This process is explained in a subsequent step but understanding the default behavior might impact how you create prices.
Repeat the steps for the Growth
and Enterprise
products, filling in the appropriate values as necessary.
Read the docs to learn more about different pricing models.
Sign up customers
To let your customers sign up for your services, you need to present a a payment form on your website. Use Stripe Checkout to embed the form on your site or redirect customers to a Stripe-hosted form. When a customer selects a recurring product and enters their billing information in the Payment Link, Stripe creates two records:
- Customer
- Subscription These records are both stored within Stripe.
Stripe offers other options for setting up your payment form:
- Payment links: Use a Payment Link as an out-of-the-box sign-up page and payment form for your customers to subscribe to a recurring product.
- Pricing tables: Create a pricing table from the Stripe Dashboard and embed it on your site. When a customer selects a plan, they’re taken to your checkout page.
- Web Elements: Build custom checkout flows to integrate with your site.
Create a usage record
Throughout each billing period, you need to report usage to Stripe so that customers are billed the correct amounts. You can maintain your own system for recording customer usage and provide usage information for subscriptions to Stripe. Learn how to record and report usage.
Test your integration
Test your integration to make sure it behaves as you expect. Learn more about testing subscriptions integrations.
You can use test clocks to test different scenarios, including mock usage records. When you make a usage reporting call, you need to sync the timestamp of the test clock with the usage records. Make a note of the test clock timestamp so that your usage records fall within the same time window. Learn more about test clocks.