Model usage-based pricing
Learn about different pricing models for usage-based billing on Stripe.
Note
We updated our usage-based billing process. For information on our previous guidance, refer to our legacy usage-based billing documentation.
There are various pricing models for usage-based billing: pay as you go, fixed fee and overage (recommended for most users), and credit burndowns.
Pay as you go
Commonly referred to as “in arrears billing”, the “pay as you go” model lets you track usage incurred over a determined period, then charge the customer at the end of the period. There are four different pricing strategies you can deploy:
- Per unit: Charge the same amount for every single unit.
- Per package: Charge for a package or bundle of units or usage. This is the model for the fictional Alpaca AI company.
- Tiered and volume based pricing: The subscription item is billed at the tier corresponding to the amount of usage at the end of the period. Learn more about volume-based pricing.
- Tiered and graduated pricing: Similar to volume pricing, graduated pricing charges for the usage in each tier instead of applying a single price to all usage.
This model might not be ideal if your business involves customers with low-trust because customers might accumulate significant usage and then have their payment method fail at the end of the month.
Fixed fee and overage model
In this model, you charge a flat fee per month for your service at the beginning of the period. This flat fee has some included usage entitlement, and any additional usage (overage) is charged at the end of the period.
You can model this with two prices within the same product. For example, Alpaca AI introduces a new advanced model called Llama AI. Priced at 200 USD per month, this model includes 100,000 tokens. Any usage beyond the included tokens is charged at an additional rate of 0.001 USD per token.
Credit burndown model
In this model, you can get prepayment for usage-based products and services. Using Billing Credits, users can pay an initial amount and “burn down” on their billing credits as they use the product.
For example, Alpaca AI wants to sell a large enterprise contract to an existing self-serve customer for their new LLama AI Model. The customer commits to pay upfront $100,000 of LLama AI so they can get $120,000 of billing credit usage to be used in a 1 year period.
Learn more about billing credits.
Free trials
You can use trial periods for subscriptions with usage-based billing. During the trial period, any usage accrued doesn’t count toward the total charged to the customer at the end of the billing cycle. After the trial period ends, usage accrues and is billed at the end of the next billing cycle.
Learn more about trial periods and subscriptions.
Webhooks and trials
Make sure that your integration properly monitors and handles web events related to changes in trial status.
A few days before a trial ends and the subscription moves from trialing
to active
, you receive a customer.
event. When you receive this event, make sure that you have a payment method on the customer’s account to proceed with billing them. Optionally, notify the customer in advance about the upcoming charge.
Status | Description |
---|---|
trialing | The subscription is currently in a trial period and it’s safe to provision your product for your customer. The subscription transitions automatically to active when the first payment is made. |
active | The subscription is in good standing and the most recent payment is successful. It’s safe to provision your product for your customer. |
incomplete | A successful payment needs to be made within 23 hours to activate the subscription. Or the payment requires action, like customer authentication. Subscriptions can also be incomplete if there’s a pending payment and the PaymentIntent status would be processing . |
incomplete_ | The initial payment on the subscription failed and no successful payment was made within 23 hours of creating the subscription. These subscriptions don’t bill customers. This status exists so you can track customers that failed to activate their subscriptions. |
past_ | Payment on the latest finalized invoice either failed or wasn’t attempted. The subscription continues to create invoices. Your subscription settings determine the subscription’s next state. If the invoice is still unpaid after all Smart Retries have been attempted, you can configure the subscription to move to canceled , unpaid , or leave it as past_ . To move the subscription to active , pay the most recent invoice before its due date. |
canceled | The subscription has been canceled. During cancellation, automatic collection for all unpaid invoices is disabled (auto_ ). This is a terminal state that can’t be updated. |
unpaid | The latest invoice hasn’t been paid but the subscription remains in place. The latest invoice remains open and invoices continue to be generated but payments aren’t attempted. You should revoke access to your product when the subscription is unpaid since payments were already attempted and retried when it was past_ . To move the subscription to active , pay the most recent invoice before its due date. |
paused | The subscription has ended its trial period without a default payment method and the trial_settings.end_behavior.missing_payment_method is set to pause . Invoices will no longer be created for the subscription. After a default payment method has been attached to the customer, you can resume the subscription. |
Learn more about subscriptions and webhooks.
Cancellations
With usage-based billing, the bill the customer pays varies based on consumption during the billing cycle. When changing the billing cycle results in ending a subscription interval early, you charge the customer for the usage accrued during the shortened billing cycle. We don’t support proration with usage-based billing.
After a subscription is canceled, you can’t reactivate it. Instead, you can collect updated billing information from your customer, update their default payment method, and create a new subscription with their existing customer record.
After you schedule the cancellation of a subscription using cancel_at_period_end, you can reactivate it at any point up to the end of the period by updating cancel_
to false
. The final invoice includes any metered usage after the subscription cancels at the end of the billing period.
Transform quantities
Use the transform_quantity option to transform usage before applying the price. This allows you to divide the reported usage by a specific number and round the result either up or down. This is commonly used when pricing on packages of a product instead of individual units. Quantity transformation isn’t compatible with tiered pricing.
For example, let’s say you have a car rental service. You report usage as a number of minutes, and you want to charge customers for each hour the car is rented.
Next, create a price for the car rental service product, charging 10 USD an hour and rounding up (to charge for a full hour even if only part of the hour is used):
If a car is rented for 150 minutes, that customer is charged 30 USD for 3 hours of renting (2 hours and 30 minutes, rounded up).
Decimal amounts
Decimal pricing is useful if you need to create pricing amounts that aren’t whole numbers. For example, if you’re running a cloud storage SaaS business, you can create a price that charges 0.05 cents for each MB used per month. Based on usage, the quantity of MB is then multiplied by 0.05 cents and rounded to the nearest whole cent.
To create prices with decimal amounts, specify unit_
instead of unit_
. unit_
allows you to set the amount in the minor unit of the currency that you charge in. For example, you can set unit_
in USD to represent 105.5 cents, or 1.055 USD. unit_
accepts decimals up to 12 decimal places.
If you plan to use tiers, you can specify unit_
instead of unit_
. You can also create invoice items with unit_
instead of unit_
.
In API responses, the integer unit_
field doesn’t populate if you create the object with a decimal value. For example, if you create a price with unit_
, the response contains unit_
and unit_
. You can still pass integer values into unit_
, in which case unit_
is populated in the response. For example, if you create a price with unit_
, the response contains unit_
and unit_
.
Note
If your integration has event handling that uses unit_
values and you begin using decimal amounts, you need to use unit_
instead. This is important because unit_
returns as null
if the decimal amounts can’t be converted into integers, which might cause errors in your integration.
Grace periods
By default, Stripe finalizes subscription invoices one hour after they’re generated. During this one hour grace period, you can continue to report usage for the previous period. When the invoice finalizes, we update it to reflect the latest quantity for its billing period.
Usage reported after the invoice finalizes aren’t captured in future invoices.
Mid-cycle updates
You can update a subscription item’s price during a billing cycle. However, the following limitations apply when switching from one billing meter price to another:
- We only reflect usage occurring after the update on future invoices. Usage occurring before the change won’t be invoiced. For example, if you have a monthly subscription that you switch from price A to price B on Jan 16th, then at the end of the month the invoice generated accounts for usage from Jan 16th to Jan 31st at price B. Usage from Jan 1st to Jan 16th isn’t billed.
- There’s one exception to this rule if you use billing thresholds and have a threshold invoice already generated at the old price. For example, in the above scenario, if you had a threshold invoice generated on January 10th using price A, that threshold invoice is still charged to the customer. At the end of the month, the invoice generated accounts for usage from January 16th to January 31st at price B. The earlier threshold invoice does not offset any usage for this end-of-month invoice.
- Similar restrictions apply if you add a new subscription item with a billing meter price in the middle of the subscription cycle. For example, if you add a new subscription item with price C on Jan 16th, then at the end of the month the invoice generated accounts for usage from Jan 16th to Jan 31st at price C for that subscription item.
Here’s how you can update price for a subscription item:
To delete a subscription item:
After deletion, we don’t reflect any usage from that item on the invoice.
Backdate subscription creation
You can report usage for a customer even before creating a subscription for them. After reporting usage for a customer, you can use backdate_start_date to create a subscription before the first report, ensuring that the usage is included in the next subscription invoice.