Sign in
An image of the Stripe logo
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
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
Integrate a SaaS business
Embed a pricing table
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
ACH Direct Debit
Bacs Direct Debit in the UK
Bank transfer
BECS Direct Debit in Australia
Pre-authorized debit in Canada
SEPA Direct Debit in the EU
iDEAL with SEPA Direct Debit
Bancontact with SEPA Direct Debit
Sofort with SEPA Direct Debit
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
Strong Customer Authentication (SCA)
Invoices API updates
Testing
No-code options
Billing
·
HomePaymentsSubscriptionsSet payment methods

Set up a subscription with SEPA Direct Debit

Use Stripe Billing to set up recurring payments.

Stripe sample

Check out the sample on GitHub or try the hosted version.

A Checkout Session represents the details of your customer’s intent to purchase. You create a Session when your customer wants to start a subscription. After redirecting your customer to a Checkout Session, Stripe presents a payment form where your customer can complete their purchase. Once your customer has completed a purchase, they will be redirected back to your site.

Set up Stripe
Server-side

Install the Stripe client of your choice:

Terminal
# For detailed setup, see our quickstarts at https://stripe.com/docs/development/quickstart bundle add stripe bundle install

Install the Stripe CLI (optional). The CLI provides webhook testing, and you can run it to create your products and prices.

Terminal
brew install stripe/stripe-cli/stripe # Connect the CLI to your dashboard stripe login

For additional install options, see Get started with the Stripe CLI.

Create the pricing model
Dashboard
Stripe CLI

Create your products and their prices in the Dashboard or with the Stripe CLI.

This example uses a fixed-price service with two different service-level options: Basic and Premium. For each service-level option, you need to create a product and a recurring price.

If you want to add a one-time charge for something like a setup fee, create a third product with a one-time price. To keep things simple, this example doesn’t include a one-time charge.

In this example, each product bills at monthly intervals. The price for the Basic product is 5 EUR; the price for the Premium product is 15 EUR.

Navigate to the Add a product page and create two products. Add one price for each product, each with a monthly recurring billing period:

  • Premium product: Premium service with extra features

    • Price: Standard model | 15 EUR
  • Basic product: Basic service with minimum features

    • Price: Standard model | 5 EUR

You don’t need to specify the unit amount in the Dashboard unless you use the package pricing model.

After you create the prices, record the price IDs so you can use them in subsequent steps. Price IDs look like this: price_G0FvDp6vZvdwRZ.

When you’re ready, use the Copy to live mode button at the top right of the page to clone your product from test mode to live mode.

For other pricing models, see Billing examples.

Create a Checkout Session
Client-side
Server-side

Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.

index.html
<html> <head> <title>Checkout</title> </head> <body> <form action="/create-checkout-session" method="POST"> <button type="submit">Checkout</button> </form> </body> </html>

Session parameters

See Create a Session for a complete list of parameters that can be used.

Create a Session with the ID of an existing Price. Ensure that mode is set to subscription and you pass at least one recurring price. You can add one-time prices in addition to recurring prices. After creating the Checkout Session, redirect your customer to the URL returned in the response.

Terminal
curl https://api.stripe.com/v1/checkout/sessions \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d "payment_method_types[]"="sepa_debit" \ -d "line_items[][price]"=
"{{PRICE_ID}}"
\ -d "line_items[][quantity]"=1 \ -d "mode"="subscription" \ -d "success_url"="https://example.com/success?session_id={CHECKOUT_SESSION_ID}" \ -d "cancel_url"="https://example.com/cancel" \

When your customer successfully completes their payment, they are redirected to the success_url, a page on your website that informs the customer that their payment was successful. Make the Session ID available on your success page by including the {CHECKOUT_SESSION_ID} template variable in the success_url as in the above example.

When your customer clicks on your logo in a Checkout Session without completing a payment, Checkout redirects them back to your website by navigating to the cancel_url. Typically, this is the page on your website that the customer viewed prior to redirecting to Checkout.

Checkout Sessions expire 24 hours after creation.

From your Dashboard, enable the payment methods you want to accept from your customers. Checkout supports several payment methods.

Don’t rely on the redirect to the success_url alone for detecting payment initiation, as:

  • Malicious users could directly access the success_url without paying and gain access to your goods or services.
  • Customers may not always reach the success_url after a successful payment—they might close their browser tab before the redirect occurs.

Confirm the payment is successful

When your customer completes a payment, Stripe redirects them to the URL that you specified in the success_url parameter. Typically, this is a page on your website that informs your customer that their payment was successful.

However, SEPA Direct Debit is a delayed notification payment method, which means that funds aren’t immediately available. A SEPA Direct Debit payment typically takes three business days to make the funds available. Because of this, you’ll want to delay order fulfillment until the funds are available. After the payment succeeds, the underlying PaymentIntent status changes from processing to succeeded.

You can confirm the payment is successful in several ways:

Successful payments appear in the Dashboard’s list of payments. When you click a payment, it takes you to the payment detail page. The Checkout summary section contains billing information and the list of items purchased, which you can use to manually fulfill the order.

Stripe can help you keep up with incoming payments by sending you email notifications whenever a customer successfully completes one. Use the Dashboard to configure email notifications.

Test the integration

You can test your integration using the IBANs below. The payment method details are successfully collected for each IBAN but exhibit different behavior when charged.

Test IBANs
Account NumberDescription
AT611904300234573201The PaymentIntent status transitions from processing to succeeded.
AT321904300235473204The PaymentIntent status transitions from processing to succeeded after three minutes.
AT861904300235473202The PaymentIntent status transitions from processing to requires_payment_method.
AT051904300235473205The PaymentIntent status transitions from processing to requires_payment_method after three minutes.
AT591904300235473203The PaymentIntent status transitions from processing to succeeded, but a dispute is immediately created.

OptionalAdding a one-time setup fee
Server-side

OptionalCreate prices and products inline
Server-side

OptionalExisting customers
Server-side

OptionalPrefill customer data
Server-side

OptionalHandling trials
Server-side

OptionalTax rates
Server-side

OptionalAdding coupons
Server-side

See also

  • Customize your integration
  • Manage subscriptions with the customer portal
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
Set up Stripe
Create the pricing model
Create a Checkout Session
Confirm the payment is successful
Test the integration
Adding a one-time setup fee
Create prices and products inline
Existing customers
Prefill customer data
Handling trials
Tax rates
Adding coupons
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.
$