For every period in a Subscription’s billing cycle, Stripe generates an invoice that represents the amount owed. If an amount is due, Stripe tries to collect payment by either automatically charging the payment method on file, or sending the invoice to customers via email.
New subscription invoices
When you subscribe a customer, Stripe:
- Creates an invoice.
- Finalizes the invoice.
If the payment succeeds on a subscription’s first invoice or the invoice does not require payment, the invoice transitions to status=paid, and the subscription becomes active.
Until the payment succeeds, the invoice status remains
open and auto_advance remains
false. The subscription status remains
incomplete. For guidance on how to handle payment failures for new subscription invoices, refer to the How subscriptions work page.
In certain cases upgrading or downgrading the subscription also creates a new invoice. These invoices set auto_advance=false from the outset.
With a finalized invoice, you cannot add invoice items or make other modifications that affect the amount due. (However, you can still add invoice items to the customer, and these will apply to the next invoice.)
Subscription renewal invoices
When subscriptions renew, Stripe:
- Creates an invoice.
- Leaves the invoice in a
draftstate for about an hour.
- Attempts to finalize and pay the invoice.
- Changes the invoice status to
paidif payment succeeds.
When the invoice is created, you’ll receive (via configured webhooks) an
invoice.created event. This time, the invoice’s status attribute will be
draft, which means that its invoice items are open for modification.
Adding extra invoice items to a future invoice
You can add up to 250 invoice items to an invoice. To add extra invoice items to the next invoice in the cycle:
These one-off items are added to the next invoice created for this customer. To make sure this is added to a specific subscription, use the optional
subscription parameter to apply it to that subscription.
Invoicing pending items more frequently
Other than changing the billing cycle, there are a few ways to invoice these items without adjusting the normal subscription cycle:
- Create a one-off invoice for the customer.
- Charge a subscription whenever the amount due reaches a threshold.
pending_invoice_item_intervalto specify an interval for how often to bill for any pending invoice items. This is equivalent to having Stripe create a one-off invoice for the subscription on a recurring basis.
Adding an extra charge or discount on a subscription’s first invoice
Include a one-time charge or discount to the first subscription invoice by using
add_invoice_items with one-time price:
Adding invoice items to a draft subscription invoice
When a subscription renews and creates an invoice, Stripe sends the
invoice.created webhook event. Stripe waits approximately one hour before finalizing the invoice and attempting payment or sending an email.
During that delay, the invoice is a
draft and is editable. It’s possible to create invoice items on that invoice. Be certain to provide the invoice parameter when creating these invoice items, otherwise they will be added as pending items and swept up into the next subscription period.
These invoice items behave slightly differently than invoice items automatically generated by Stripe:
- Pending invoice items are always charged when the billing period ends for any subscription that is canceled. Canceling a customer’s subscription means only that the customer isn’t billed again if no invoice items exist.
- Pending invoice items are not prorated when a customer’s subscription is changed.
If there are pending invoice items that remain even after a subscription is canceled, Stripe will generate an invoice and will attempt to bill the customer for these items at the end of the next billing period. These invoice items are (similarly) not prorated when a subscription is changed.
Previewing upcoming invoices
The Retrieve an invoice API call provides a mechanism for viewing an existing invoice, but Stripe also provides an endpoint for previewing the next upcoming invoice. This preview reflects the base price, pending invoice items, discounts, and any existing customer credit balance.
When fetching the preview, you can also model what the invoice would look like if you changed the subscription in one of these ways:
- Swapping the underlying price.
- Altering the quantity.
- Applying a trial period.
- Adding a coupon.
Generating an invoice for subscription items outside the billing cycle
You can invoice pending invoice items outside of the regular billing cycle by generating a one-off invoice. Generating a one-off invoice pulls in any pending invoice items that would have been added to the regularly scheduled invoice.
Pausing a subscription invoice for review
Rather than automatically attempting payment at the end of a billing period, you can pause the invoice for review or corrections. To pause an invoice:
- Pause automatic collection within one hour of receiving the
invoice.createdevent. You can do this by setting
auto_advance=falsein the API, or by pressing the Dashboard’s Turn off automatic collection button. This prevents Stripe from automatically attempting payment from your customer for the invoice amount, and from sending the invoice via email.
- Review the invoice.
- Once you are ready to attempt payment, resume automatic collection. You can do so either by setting
auto_advance=truethrough the API, or by clicking the Dashboard’s Turn on automatic collection button.