Manage your usage-based billing setup
Learn how to handle billing-related tasks for your usage-based billing model.
After you create your usage-based billing model, you can modify different parts of your billing setup. For example, you can update a subscription item’s price during a billing cycle, backdate a subscription to include usage in the next invoice, or cancel usage-based subscriptions.
Update prices mid-cycle
You can update a subscription item’s price during a billing cycle.
With billing_
subscriptions, we create an invoice item that bills for previously reported metered usage when you remove a metered price from a subscription.
For example, say you have a monthly subscription that you switch from price A to price B on 16 January. On 16 January, we create an invoice item billing for usage from 1 January to 16 January. When the subscription cycles on 1 February, we bill for price B from 16 January to 1 February.
The proration_behavior you specify when removing a metered price affects these metered invoice items. If you want to remove a metered price without billing for it, set proration_
to none
.
With billing_
subscriptions, limitations apply when switching from one meter price to another.
On future invoices, we reflect only usage that occurs after the update. For example, say you have a monthly subscription that you switch from price A to price B on 16 January. At the end of the month, the invoice includes usage from 16 January to 31 January at price B. Usage from 1 January to 16 January isn’t billed.
An exception exists if you use billing thresholds and have a threshold invoice already generated at the old price. For example, say you generate a threshold invoice on 10 January using price A. You still charge that threshold invoice to the customer. At the end of the month, the invoice includes usage from 16 January to 31 January at price B. The earlier threshold invoice doesn’t 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, say you add a new subscription item with price C on 16 January. At the end of the month, the invoice includes usage from 16 January to 31 January at price C for that subscription item.
To capture previously reported usage when changing prices, choose one of these options:
- Report the aggregated usage again to capture it in the cycle on the new price.
- Reset the billing_cycle_anchor parameter to
now
, applying the old price to previously reported usage.
To update the price for a subscription item:
To delete a subscription item:
After deletion, the invoice doesn’t reflect any usage from that item.
Create a backdated subscription
You can record usage for a customer even before creating a subscription for them. After recording usage for a customer, use the backdate_start_date to create a subscription before the first report.
With billing_
subscriptions, the subscription’s first invoice includes this backdated usage.
With billing_
subscriptions, the subscription’s next invoice, generated when it cycles, includes this backdated usage.
Cancel usage-based subscriptions
With usage-based billing, the bill the customer pays varies based on consumption during the billing cycle. When changing the billing cycle results in a subscription interval ending early, you charge the customer for the usage accrued during the shortened billing cycle.
Note
We don’t support proration with usage-based billing.
You can’t reactivate cancelled subscriptions. 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.
If you use cancel_at_period_end to schedule the cancellation of a subscription, you can reactivate the subscription at any time up to the end of the period. To do so, update cancel_
to false
.
For subscriptions that cancel at the end of the period, the final invoice at the end of the cycle includes metered usage from the last billing cycle.