Sign in
An image of the Stripe logo
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
Security
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support
Overview
Overview
How subscriptions work
How to model subscriptions
Get started
Quickstart
Design an integration
Build a subscriptions integration
Integrate the customer portal
Migrate subscriptions to Stripe
Billing resources
Coupons
Customers
Subscriptions
Subscription invoices
Manage subscriptions
Change subscriptions
Usage-based billing
Use trial periods
Set payment methods
Subscriptions with multiple products
Set subscription quantities
Subscription webhooks
Schedule subscriptions
Tax
Integrate with Salesforce
Manage recurring revenue
Revenue recognition
Revenue recovery
Subscription metrics
Testing
Test your integration
Test clocks
Metered billing with Elements
Fixed-price billing with Elements
Per-seat billing with Elements
Migrate to Prices
Strong Customer Authentication (SCA)
Invoices API updates
Improved tax support
Testing
No-code options
Billing
·
HomePaymentsSubscriptions

Designing an integration

Learn what choices you need to make to integrate subscriptions into your business.

Before you start building your subscription integration, you’ll need to choose the right integration path, especially if you’re not writing the code yourself and need to collaborate with others. Use this guide to help you decide on the best way to build your integration, and follow the links to in-depth, step-by-step guides.

This guide is for users who aren’t necessarily writing code but want to learn about the high-level subscription integration process so that they can create plans and organize resources.

If you already know how you’re going to build your integration, or if you want to start coding right away, see our integration builder.

Subscription models

Understanding the available subscription models is an important initial step in your integration as it informs later choices, like which pricing model and payment form to use. First, consider your business model:

  • Do you want customers to pay, then provision access to your service?
    • Click the pay up front tab below to learn more.
  • Do you want to collect payment details, then offer customers a free trial period before billing them?
    • Click the free trial tab below to learn more.
  • Do you want to provide users access to your service without asking them for any payment information (a freemium model)?
    • Click the freemium tab below to learn more.
Pay-up-front subscription model

Pay-up-front model

In the pay-up-front model, you collect payment details and charge customers before provisioning access to your service. After the initial charge, you continue to charge customers the same fixed price for the same service at regular intervals. In this model, you use the Dashboard or Subscriptions API manage customer subscriptions. If you want to allow customers to modify their subscriptions directly, you need to integrate the customer portal.

For example, a photo hosting company that offers basic and premium service levels and charges customers on a monthly basis might have this setup:

  • One product for the basic option
  • One product for the premium option
  • One price for the basic option (15 USD per month)
  • One price for the premium option (25 USD per month)

A typical flow for this model would look like this:

More about webhooks in the flow

In step 3, the specific event you’re looking for is called checkout.session.completed. If you’re using Elements, provision access after receiving an invoice.paid event.

In step 4, look for an event called invoice.paid.

  1. The customer chooses their plan (basic or premium).
  2. You collect payment information.
  3. You provision access to your service. You know when to do this by monitoring webhook events.
  4. You continue to provision access for customers throughout the lifecycle of the subscription. Check regularly to make sure you’re not providing access if a customer’s payment has failed.

See the integration guide to learn how to build an integration with a low-code approach that uses a prebuilt and hosted page from Stripe Checkout or a custom version with Stripe Elements.

Metered billing

If you need to meter usage, see metered billing. You need to do this when you create a price.

Collect payment information

How do you want to collect payment information?

If you don’t want to write a lot of code, use Checkout, Stripe’s prebuilt, hosted payment page. See the subscriptions with Checkout integration guide to get started.

If you want a more customized payment form that you can embed into your existing website, use Elements, a set of prebuilt UI elements that’s part of Stripe.js.

Modifying subscriptions

How do you want your customers to modify their subscriptions after setting them up for the first time?

If you’re collecting payment information with Checkout, you can use the customer portal to allow customers to directly update their subscription details, like payment method and frequency. See the integration guide for detailed instructions on setting this up. (Before integrating, you should also be aware of the limitations of the portal.)

If you’re integrating with Elements, you can add a form on the frontend to collect details about the plan they want to change (like the price ID and their customer information) and send that to an endpoint on the backend. For more details and sample code, see the section about letting customers change their plans in the Elements quickstart.

Pricing models

If you’re providing the same good every month and don’t expect that to change, use a simple fixed-price model. If the price varies depending on the number of users or units, you can use volume-based or tier-based prices. For a complete list of available models and a detailed description of each one, see examples of pricing models.

Set up webhooks

Set up webhooks to receive notifications about subscription-related events. For example, when you see the invoice.paid=true notification, you can safely provision access to your service. See the subscription lifecycle for more information about webhook events. See subscription events for a complete list of subscription-related events.

OptionalOther considerations

Was this page helpful?
Questions? Contact us.
View developer tutorials on YouTube.
Check out our product changelog.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Subscription models
Metered billing
Collect payment information
Modifying subscriptions
Pricing models
Set up webhooks
Other considerations
Stripe Shell
Test mode
▗▄ ▄▟█ █▀▀ ▗▟████▙▖ ██████ ███▗▟█ ███ ███▗▟██▙▖ ▗▟█████▙▖ ███▖ ▀▀ ███ ███▀▀▀ ███ ███▀ ███ ███ ███ ▝▜████▙▖ ███ ███ ███ ███ ███ █████████ ▄▄ ▝███ ███ ▄ ███ ███ ███▄ ███ ███ ▄▄ ▝▜████▛▘ ▝▜███▛ ███ ███ ███▝▜██▛▘ ▝▜█████▛▘ ███ ▀▘
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Login to Stripe docs and press Control + Backtick on your keyboard to start managing your Stripe resources in test mode. - View supported commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g. )
The Stripe Shell is best experienced on desktop.
$