Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
Overview
Billing
OverviewAbout the Billing APIs
Subscriptions
    Overview
    How subscriptions work
    Get started
    Quickstart
    Plan an integration
    Build an integration
    Use cases
    About subscriptions
    Enable billing mode
    Subscription event definitions
    Entitlements
    Subscription invoices
    Subscription schedules
    Recurring pricing models
    Strong Customer Authentication (SCA)
    Set up subscriptions
    Configure collection methods
    Embed a pricing table
    Set billing cycles
    Manage subscriptions
    Migrate subscriptions to Stripe
    Set product or subscription quantities
    Mixed interval subscriptions
    Backdate subscriptions
    Set trial periods
    Handle subscriptions with deferred payment
    Apply coupons
    Modify subscriptions
    Manage subscription payment methods
    Analytics
    Manage subscriptions on iOS
Invoicing
Usage-based billing
Quotes
Customer management
Billing with other products
Revenue recovery
Automations
Test your integration
Tax
Overview
Use Stripe tax
Manage compliance
Reporting
Overview
Select a report
Configure reports
Reports API
Reports for multiple accounts
Revenue recognition
Data
OverviewSchema
Custom reports
Data Pipeline
Data management
HomeRevenueSubscriptions

How subscriptions work

Manage recurring payments and subscription lifecycles.

With Subscriptions, customers make recurring payments for access to a product. Subscriptions require you to retain more information about your customers than one-time purchases because you need to charge them in the future.

Stripe offers many features that help you manage subscription billing:

  • Support for different pricing models
  • Subscription discount management
  • Trial management
  • Prorations for modified subscriptions
  • Customer self-service management
  • Invoicing to collect payments
  • Automated revenue recovery
  • Reporting and analytics

The subscription lifecycle

The process of creating and managing subscriptions relies on core Stripe API resources, including Customers, Invoices, and PaymentIntents. See API object definitions for the full list of subscription-related resources.

This is what the recommended subscription flow looks like:

Create the subscription

You can create a new subscription in the Dashboard or with the API. Every time you create a subscription, this triggers an event. Listen for these events with webhook endpoints, and make sure that your integration properly handles them.

Optionally, you can create a trial that doesn’t require payments for the subscription. In that case, the status is trialing. When the trial is over, the subscription moves to active and the subscribed customer gets charged.

Payment behavior

We recommend that you set the payment_behavior of a subscription to default_incomplete to help handle failed payments and complex payment flows like 3DS. This creates subscriptions with status incomplete if payment is required, which allows you to subsequently collect and confirm payment information to activate the subscription.

If you set payment_behavior to allow_incomplete, Stripe immediately attempts to collect payment on the invoice. If the payment fails, the subscription’s status changes to incomplete. If you set payment_behavior to error_if_incomplete, the subscription creation fails if the payment fails.

Subscriptions that you create in the Dashboard default to the appropriate payment behavior depending on the payment method.

Handle the invoice

When you create a subscription, Stripe automatically creates an invoice with the status open. Your customer has about 23 hours to make a successful payment. During this time, the subscription status is incomplete and the invoice status remains open. The 23-hour window exists because your customer usually makes the first payment for a subscription while on-session. If the customer returns to your application after 23 hours, create a new subscription for them.

The customer pays

If your customer pays the invoice, the subscription updates to active and the invoice to paid. If they don’t make a payment, the subscription updates to incomplete_expired and the invoice becomes void.

To confirm whether the invoice has been paid:

  • Set up a webhook endpoint or another type of event destination and listen for the invoice.paid event.
  • Manually check the subscription object and look for subscription.status=active. The status becomes active when the invoice has been paid either through an automatic charge or having the customer pay manually.

For more details, see Subscription statuses and Payment statuses.

Provision access to your product

When you create a subscription for a customer, this creates an active entitlement for each feature associated with that product. When a customer accesses your services, use their active entitlements to grant them access to the features included in their subscription.

Alternatively, you can use track active subscriptions with webhook events and provision the product for the customer based on that activity.

Update the subscription

You can modify existing subscriptions as needed without having to cancel and recreate them. Some of the most significant changes you might make are upgrading or downgrading the subscription price or pausing payment collection for an active subscription.

You can listen to subscription events with webhook endpoints for changes to the subscription. For example, you might want to email a customer if a payment fails or revoke a customer’s access when they cancel their subscription.

For Stripe Checkout integrations, you can’t update the subscription or its invoice if the session’s subscription is incomplete. You can listen to the checkout.session.completed event to make the update after the session has completed. You can also expire the session instead if you want to cancel the session’s subscription, void the subscription invoice, or mark the invoice as uncollectible.

Handle unpaid subscriptions

For subscriptions with unpaid invoices, the unpaid invoices remain open but further payment attempts are paused. The subscription continues to generate invoices each billing period, which remain in the draft status. To reactivate the subscription:

  1. Collect new payment information if necessary.
  2. Enable automatic collection by setting auto_advance to true on draft invoices.
  3. Finalize and pay the open invoices. Paying the most recent non-voided invoice before its due date updates the subscription status to active.

Invoices marked as uncollectable keep the underlying subscription active. Stripe ignores voided invoices when determining subscription status and uses the most recent non-voided invoice instead.

The unpaid subscription’s status depends on your failed payment settings in the Dashboard.

Cancel the subscription

You can cancel a subscription at any time, including at the end of a billing cycle or after a set number of billing cycles.

By default, cancelling a subscription disables creating new invoices and stops automatic collection of all outstanding invoices from the subscription. It also deletes the subscription and you can no longer update the subscription or its metadata. If your customer wants to resubscribe, you need to collect new payment information from them and create a new subscription.

Subscription statuses

Subscriptions can have the following statuses. The actions you can take on a subscription depend on its status.

StatusDescription
trialingThe subscription is currently in a trial period and you can safely provision your product for your customer. The subscription transitions automatically to active when a customer makes the first payment.
activeThe subscription is in good standing. For past_due subscriptions, paying the latest associated invoice or marking it uncollectible transitions the subscription to active. Note that active doesn’t indicate that all outstanding invoices associated with the subscription have been paid. You can leave other outstanding invoices open for payment, mark them as uncollectible, or void them as you see fit.
incompleteThe customer must make a successful payment within 23 hours to activate the subscription. Or the payment requires action, such as customer authentication. Subscriptions can also be incomplete if there’s a pending payment and the PaymentIntent status is processing.
incomplete_expiredThe initial payment on the subscription failed and the customer didn’t make a successful payment within 23 hours of subscription creation. These subscriptions don’t bill customers. This status exists so you can track customers that failed to activate their subscriptions.
past_duePayment on the latest finalized invoice either failed or wasn’t attempted. The subscription continues to create invoices. Your Dashboard subscription settings determine the subscription’s next status. If the invoice is still unpaid after all attempted smart retries, you can configure the subscription to move to canceled, unpaid, or leave it as past_due. To reactivate the subscription, have your customer pay the most recent invoice. The subscription status becomes active regardless of whether the payment is done before or after the latest invoice due date.
canceledThe subscription was canceled. During cancellation, automatic collection for all unpaid invoices is disabled (auto_advance=false). This is a terminal state that can’t be updated.
unpaidThe latest invoice hasn’t been paid but the subscription remains in place. The latest invoice remains open and invoices continue to generate, but payments aren’t attempted. Revoke access to your product when the subscription is unpaid because payments were already attempted and retried while past_due. To move the subscription to active, pay the most recent invoice before its due date.
pausedThe 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 are no longer created for the subscription. After attaching a default payment method to the customer, you can resume the subscription.

Payment statuses

A PaymentIntent tracks the lifecycle of every payment. Whenever a payment is due for a subscription, Stripe generates an invoice and a PaymentIntent. The PaymentIntent ID attaches to the invoice and you can access it from the Invoice and Subscription objects.

The status of the PaymentIntent affects the status of the invoice and the subscription. Here’s how the different outcomes of a payment map to the different statuses:

Payment outcomePaymentIntent statusInvoice statusSubscription status
Successsucceededpaidactive
Fails because of a card errorrequires_payment_methodopenincomplete
Fails because of authenticationrequires_actionopenincomplete

Note

Asynchronous payment methods, such as ACH Direct Debit, handle subscription status transitions differently than immediate payment methods. When you use asynchronous methods, subscriptions transition directly to an active state after creation, bypassing the incomplete state typically associated with other payment types. If an asynchronous payment fails later, it voids the associated invoice but the subscription remains in the active state. This behavior contrasts with immediate payment methods, where failed payments often lead to incomplete or past_due states. Be aware of this distinction and implement appropriate logic to manage subscription status, access control, and payment retry mechanisms.

The following sections explain these statuses and the actions to take for each.

Payment succeeded

When the customer’s payment is successful:

  • The status of the PaymentIntent moves to succeeded.
  • The status of the subscription is active.
  • The status of the invoice is paid.
  • Stripe sends an invoice.paid event to your configured webhook endpoints.

For payment methods with longer processing periods, subscriptions are immediately activated. In these cases, the status of the PaymentIntent might be processing for an active subscription until the payment succeeds.

With your subscription now activated, provision access to your product.

Requires payment method

If payment fails because of a card error such as a decline:

  • The status of the PaymentIntent is requires_payment_method.
  • The status of the subscription is incomplete.
  • The status of the invoice is open.

To handle these scenarios:

  • Notify the customer.
  • Collect new payment information and confirm the PaymentIntent.
  • Update the default payment method on the subscription.
  • Stripe re-attempts payment using Smart Retries or based on your custom retry rules.
  • Use the invoice.payment_failed event to monitor subscription payment failure events and retry attempt updates. After a payment attempt on an invoice, its next_payment_attempt value is set using the current subscription settings in your Dashboard.

Learn how to handle payment failures for subscriptions.

Requires action

Some payment methods require customer authentication with 3D Secure (3DS) to complete the payment process. 3DS completes the authentication process. Whether a payment method requires authentication depends on your Radar rules and the issuing bank for the card.

If payment fails because the customer needs to authenticate a payment:

  • The status of the PaymentIntent is requires_action.
  • The status of the subscription is incomplete.
  • The status of the invoice is open.

To handle these scenarios:

  • Monitor for the invoice.payment_action_required event notification with webhook endpoints. This indicates that authentication is required.
  • Notify your customer that they must authenticate.
  • Retrieve the client secret for the PaymentIntent and pass it in a call to stripe.ConfirmCardPayment. This displays an authentication modal to your customers, attempts payment, then closes the modal and returns context to your application.
  • Monitor the invoice.paid event on your event destination to verify that the payment succeeded. Users can leave your application before confirmCardPayment() finishes. Verifying whether the payment succeeded allows you to correctly provision your product.

See also

  • Design a subscriptions integration
  • Subscriptions quickstart
  • Example: Subscription with a fixed price
Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Join our early access programme.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc