Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
    Overview
    Quickstarts
    Customise look and feel
    Collect additional information
    Collect taxes
    Dynamically update checkout
    Manage your product catalogue
    Subscriptions
      Configure free trials
      Limit customers to one subscription
      Set billing cycle date
    Manage payment methods
    Let customers pay in their local currency
    Add discounts, upsells, and optional items
    Set up future payments
    Save payment details during payment
    Manually approve payments on your server
    After the payment
    Elements with Checkout Sessions API beta changelog
    Migrate from legacy Checkout
    Migrate Checkout to use Prices
Build an advanced integration
Build an in-app integration
Payment Methods
Add payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsBuild a checkout pageSubscriptions

Configure free trials

Delay payments on subscriptions using free trial periods.

Copy page

Stripe doesn’t set a specific limit on a free trial length. Most businesses use shorter trials (such as 30 days), but you can set longer periods. However, consider:

  • Keeping payment methods valid for post-trial charges
  • Potential impact on conversion rates with longer trials

You can configure a Checkout Session to start a customer’s subscription with a free trial by passing one of the following parameters:

  • subscription_data.trial_period_days, the length (in days) of your free trial.
  • subscription_data.trial_end, a Unix timestamp representing the end of the trial period.
Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d mode=subscription \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel" \ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "subscription_data[trial_period_days]"=30

Free trials without collecting a payment method

By default, Checkout Sessions collect a payment method to use after the trial ends. You can sign customers up for free trials without collecting payment details by passing payment_method_collection=if_required.

Choose whether to cancel or pause the subscription if the customer doesn’t provide a payment method before the trial ends by passing trial_settings.end_behavior.missing_payment_method.

  • Cancel subscription-If the free trial subscription ends without a payment method, it cancels immediately. You can create another subscription if the customer decides to subscribe to a paid plan in the future.
  • Pause subscription-If the free trial subscription ends without a payment method, it pauses and doesn’t cycle until it’s resumed. When a subscription is paused, it doesn’t generate invoices (unlike when a subscription’s payment collection is paused). When your customer adds their payment method after the subscription has paused, you can resume the same subscription. The subscription can remain paused indefinitely.
Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d mode=subscription \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel" \ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "subscription_data[trial_period_days]"=30 \ -d "subscription_data[trial_settings][end_behavior][missing_payment_method]"=cancel \ -d payment_method_collection=if_required

Collect payment details automatically

Before the trial expires, collect payment details from your customer.

Under Manage free trial messaging in your Subscriptions and emails settings, you can choose to automatically send a reminder email when a customer’s trial is about to expire.

Next, select the Link to a Stripe-hosted page option so the reminder email contains a link for the customer to add or update their payment details. We don’t send free trial reminder emails in a sandbox. Learn more about how to set up free trial reminders.

You must comply with card network requirements when offering trials. Learn more about compliance requirements for trials and promotions.

Collect payment details in the Billing customer portal

You can also send the reminder email yourself, and redirect customers to the Billing customer portal to add their payment details.

First, configure the Billing customer portal to enable your customers to manage their subscriptions.

Next, collect billing information from your customers:

  1. Listen to the customer.subscription.trial_will_end event.
  2. If the subscription doesn’t have a default payment method, get the customer’s email using the Customers API and send them a message with a link to your site. It’s helpful to embed the customer ID in the email, for example https://example.com?...&customer={{CUSTOMER_ID}}.
  3. When the customer lands on your site, create a customer portal session using the customer ID from the previous step.
  4. Redirect the customer to the customer portal, where they can update their subscription with payment details.

Your customers can also resume their paused subscription in the customer portal by selecting Start subscription, then adding a payment method. View free trial periods to learn how to configure a subscription to pause or cancel when a free trial ends without a payment method attached.

Combining trials with usage-based billing

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.

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