Skip to content
Sign in
An image of the Stripe logo
/
Create account
Sign in
Home
Payments
Finance automation
Banking as a service
Developer tools
No-code
All products
Home
Payments
Finance automation
Home
Payments
Finance automation
Banking as a service
Developer tools
Overview
Get started
About Stripe payments
Start an integration
Payment Links
Checkout
Web Elements
Mobile Elements
Payment scenarios
During the payment
After the payment
Add payment methods
    Overview
    Payment method integration options
    Multiple payment method configurations on dynamic payment methods
    A/B testing on dynamic payment methods
    Payment method targeting on dynamic payment methods
    Register payment method domains
    Bank debits
    Bank redirects
      Bancontact
      BLIK
      EPS
      FPX
      giropay
      iDEAL
      Przelewy24
      Sofort
        Accept a payment
        Save bank details during payment
        Set up future payments
    Bank transfers
    Buy now, pay later
    Credit transfers (Sources)
    Real-time payments
    Regional card installments
    Vouchers
    Wallets
More payment scenarios
Faster checkout with Link
Other Stripe products
Connect
Terminal
Radar
Financial Connections
Crypto
Identity
Climate
Resources
About the APIs
Implementation guides
Regulation support
Testing
HomePaymentsBank redirectsSofort

Use Sofort to set up future SEPA Direct Debit payments

Learn how to save bank details from a Sofort payment and charge your customers later with SEPA Direct Debit.

Caution

We recommend that you follow the Set up future payments guide. If you’ve already integrated with Elements, see the Payment Element migration guide.

Sofort payments

See Save bank details during payment if you need to accept a payment and save IBAN details.

Sofort is a single use payment method where customers are required to authenticate each payment. With this integration, Stripe charges your customer 1 EUR through Sofort in order to collect their bank details. After your customer authenticates the payment, Stripe refunds the payment and store your customer’s IBAN in a SEPA Direct Debit payment method. You can then use the SEPA Direct Debit PaymentMethod to accept payments or set up a subscription.

Caution

To use Sofort to set up SEPA Direct Debit payments, you must SEPA Direct Debit in the Dashboard. You must also comply with our Sofort Terms of Service and SEPA Direct Debit Terms of Service.

You can use Checkout in setup mode to collect payment details and set up future SEPA Direct Debit payments using Sofort.

Create or retrieve a Customer
Server-side

To set up future SEPA Direct Debit payments using Sofort, you must attach the SEPA Direct Debit payment method to a Customer.

Create a Customer object when your customer creates an account with your business. You can retrieve and use a customer’s stored payment method details later, if you associate the ID of the Customer object with your own internal representation of the customer.

Command Line
curl -X POST https://api.stripe.com/v1/customers \ -u "
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:"

Set up future payments

This guide builds on the foundational set up future payments Checkout integration and describes how to enable Sofort—it shows the differences between setting up future payments for cards and using Sofort.

Enable Sofort as a payment method

When creating a new Checkout Session, you need to add sofort to the list of payment_method_types.

Stripe::Checkout::Session.create({ mode: 'setup', payment_method_types: ['card'], payment_method_types: ['card', 'sofort'], customer: customer.id, success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', })

Charge the SEPA Direct Debit PaymentMethod later
Server-side

When you need to charge your customer again, create a new PaymentIntent. Find the ID of the SEPA Direct Debit payment method by retrieving the SetupIntent and expanding the latest_attempt field where you will find the generated_sepa_debit ID inside of payment_method_details.

Command Line
curl -G https://api.stripe.com/v1/setup_intents/{{SETUP_INTENT_ID}} \ -u "
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:"
\ -d "expand[]"=latest_attempt

Create a PaymentIntent with the SEPA Direct Debit and Customer IDs.

Command Line
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:"
\ -d "payment_method_types[]"=sepa_debit \ -d amount=1099 \ -d currency=eur \ -d customer=
{{CUSTOMER_ID}}
\ -d payment_method={{SEPA_DEBIT_PAYMENT_METHOD_ID}} \ -d confirm=true

Test your integration

When testing your Checkout integration, select Sofort as the payment method and click the Pay button.

See also

  • Accept a SEPA Direct Debit payment
  • Set up a subscription with SEPA Direct Debit in the EU
Was this page helpful?
Need help? Contact Support.
Watch our developer tutorials.
Check out our product changelog.
Questions? Contact Sales.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Create or retrieve a Customer
Set up future payments
Charge the SEPA Direct Debit PaymentMethod later
Test your integration
See also
Products Used
Payments
Stripe Shell
Test mode
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Log in to your Stripe account and press Control + Backtick (`) on your keyboard to start managing your Stripe resources in test mode. - View supported Stripe 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.
$