Invite only
Swish payments Invite only
Learn how to accept Swish, a popular payment method in Sweden.
Checkout
Elements
Direct API
Mobile
Swish is a single-use payment method used in Sweden. It allows customers to authenticate and approve payments using the Swish mobile app and the Swedish BankID mobile app.
You get immediate notification on whether the payment succeeded or failed.
Use this guide to enable Swish on Checkout, our hosted checkout form, and learn the differences between accepting a card payment and a Swish payment.
Determine compatibility
A Checkout Session must satisfy all of the following conditions to support Swish payments:
- Prices for all line items must be expressed in SEK.
Set up Stripe Server-side
First, you need a Stripe account. Register now.
Use our official libraries for access to the Stripe API from your application:
Command Line
Select a language
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Available as a gem
sudo gem install stripe
Gemfile
Select a language
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# If you use bundler, you can add this line to your Gemfile
gem 'stripe'
Accept a payment
Note
This guide builds on the foundational accept a payment Checkout integration.
Enable Swish as a payment method
When creating a new Checkout Session, you need to:
- Enable Swish in your Dashboard. Stripe automatically displays Swish to eligible customers using dynamic payment methods . If you currently specify payment _ method _ types , see the migration guide .
- Make sure all your line _ items use the sek currency.
Command Line
Select a language
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
Fulfill your orders
After accepting a payment, learn how to fulfill orders.
Optional Handle post-payment events
Optional Test the integration
Failed payments
Swish uses multiple data points to decide when to decline a transaction (for example, there aren’t enough funds in the customer’s bank account, or the customer has clicked Cancel in the app).
In these cases, the PaymentMethod is detached and the PaymentIntent object’s status automatically transitions to requires_payment_method.
Other than a payment being declined, for a Swish PaymentIntent with a status of requires_action, customers must complete the payment within 3 minutes. If no action is taken after 3 minutes, the PaymentMethod is detached and the PaymentIntent object’s status automatically transitions to requires_payment_method.
Decline codes
When a Swish payment is declined, the last_payment_error.network_decline_code on the PaymentIntent contains a raw decline code from Swish. The following table lists the possible values and their meanings.
network_decline_code | decline_code | code | message |
|---|---|---|---|
the related setting | payment_limit_exceeded | payment_method_provider_decline | The customer has exceeded their self-configured Swish daily spending limit. The customer should raise their daily limit in their online bank or pay with a different payment method. |
the related setting | invalid_amount | payment_method_provider_decline | The payment amount exceeds the customer’s self-configured Swish transaction limit. The customer should raise their transaction limit in their online bank or pay with a different payment method. |
the related setting | partner_generic_decline | payment_method_provider_decline | The transaction was declined by Swish for an unknown reason. |
the related setting | partner_generic_decline | payment_method_provider_decline | The customer canceled BankID signing. |
the related setting, the related setting | invalid_customer_account | payment_method_provider_decline | The customer isn’t enrolled to pay via Swish. The customer should enroll in Swish or pay with a different payment method. |
the related setting | invalid_customer_account | payment_method_provider_decline | The customer isn’t enrolled or not permitted to pay via Swish. |
the related setting | partner_generic_decline | payment_method_provider_decline | The customer already has an active Swish payment in progress. The customer should terminate the existing Swish payment or pay with a different payment method. |
the related setting | invalid_customer_account | payment_method_provider_decline | The customer is enrolled in Swish but has not yet activated their Swish app. The customer should activate their Swish app or pay with a different payment method. |
the related setting | payment_intent_payment_attempt_expired | payment_intent_payment_attempt_failed | The latest payment attempt of this PaymentIntent has expired. You can provide payment_method_data or a new PaymentMethod to attempt to fulfill this PaymentIntent again. |
the related setting | processing_error | payment_method_provider_decline | The processing bank returned an error. Try again in a little bit or try a different payment method. |
the related setting, the related setting | partner_generic_decline | payment_method_provider_decline | The customer already has an ongoing operation with BankID. This could be another Swish payment, a bank login, or an e-government login, for example. The customer should terminate the ongoing BankID operation and try again. |
the related setting, the related setting, the related setting, the related setting, the related setting, the related setting, the related setting, the related setting, the related setting, the related setting | processing_error | payment_intent_payment_attempt_failed | Swish encountered an error while processing this transaction. Try again in a little bit or try a different payment method. |
