Swish for API only
Beta
Last updated: September 17, 2025
To accept Swish payments, follow these steps:
- Request a payment.
- Redirect the customer.
Call the Request a payment endpoint:
post
https://api.checkout.com/payments/
1{2"amount": 100,3"currency": "SEK",4"source": {5"type": "swish",6"account_holder":{7"first_name":"Hannah",8"last_name":"Bret"9},10"payment_country": "SE"11},12"billing_descriptor": {13"name": "merchant name"14}15}
1{2"id": "pay_3j4564ofxydevmruz6amur7djq",3"status": "Pending",4"reference": "example-ref",5"payment_type": "Regular",6"_links": {7"self": {8"href": "https://gwc.ckotech.co/payments/pay_3j4564ofxydevmruz6amur7djq"9},10"redirect": {11"href": "https://authman.sandbox.lp-pl.ppro.com/v0/pages/?redirection_token=eyJhbGciOiJIUzUxMiJ9.eyJzZXNzaW9uIjp7InIiOiJjaGFyZ2VfeFJWYVZaa0czeFBQTzBuZzd0czNhIn19.lfNRW50Wt-Au9l-daxQ6bi8N1XRbdJmVH4XFlPByhH16iJr-QlPEPZFPWD-8MX4-A8c2NPbeTaujr8ernyl4cg",12"qr_code": {13"text": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAsNklEQVR4Xu2d+5tdZZXn..."14},15"mobile": {16"android": {17"href": "swish://paymentrequest?token=AAAAAAAAAAAAABUCIDZXYpP3hM2Mx1Le&callbackurl=https%3A%2F%2Fqaapi.ckotech.co%2Fapms%2Fppro%2Fswish%2Fredirect%2Ftok_lzwgligaujlu5betpu3afjq4ju%3Ftxid%3D150220365762%26cs%3D058372607475360e841ac289156780f618cc79869d3d762af0dbe72f2eeb59db"18},19"ios": {20"href": "swish://paymentrequest?token=AAAAAAAAAAAAABUCIDZXYpP3hM2Mx1Le&callbackurl=https%3A%2F%2Fqaapi.ckotech.co%2Fapms%2Fppro%2Fswish%2Fredirect%2Ftok_lzwgligaujlu5betpu3afjq4ju%3Ftxid%3D150220365762%26cs%3D058372607475360e841ac289156780f618cc79869d3d762af0dbe72f2eeb59db"21}22}23}24}25}
If you receive a 202 response, with the status field set to Pending, your request was successful.
The redirection step varies depending on whether you request the payment from:
- A desktop browser
- A mobile app
To request a payment from a desktop browser:
- Ensure that the Swish app is installed on your customer's phone.
- Redirect your customer to the
_links.redirect.hrefURL provided in the response.
The URL displays a QR code. - Your customer must scan the code using their Swish app and authorize the payment on their device.
- After authorizing the payment, the customer is redirected to either your success or failure URL.
To request a payment from a mobile app:
- Ensure that the Swish app is installed on your customer's phone.
If the application is not installed, instruct the customer to install it. - Get the necessary token from the
redirect.mobileobject in the response:- For Android – Pass the deeplink provided in
redirect.mobile.androidto open the Swish app in your customer's phone - For iOS – Pass the deeplink provided in
redirect.mobile.iosto open the Swish app in your customer's phone
- For Android – Pass the deeplink provided in
- The Swish app launches on your customer's phone, where they can authorize the payment.
To retrieve details about the payment, call the Get payment details endpoint, and provide the payment_id value you received in the Create a payment response as the {id} path parameter.
get
https://api.checkout.com/payments/{id}
1{2"id": "pay_4k4b3jkvgmuexfpiww6nzhf4ru",3"requested_on": "2025-08-22T13:15:09.3823555Z",4"source": {5"type": "swish"6},7"amount": 123,8"currency": "SEK",9"payment_type": "Regular",10"reference": "example-ref",11"status": "Captured",12"approved": true,13"balances": {14"total_authorized": 123,15"total_voided": 0,16"available_to_void": 0,17"total_captured": 123,18"available_to_capture": 0,19"total_refunded": 0,20"available_to_refund": 12321},22"billing_descriptor": {23"name": "merchant name"24},25"_links": {26"self": {27"href": "https://api.sandbox.checkout.com/payments/pay_4k4b3jkvgmuexfpiww6nzhf4ru"28},29"actions": {30"href": "https://api.sandbox.checkout.com/payments/pay_4k4b3jkvgmuexfpiww6nzhf4ru/actions"31},32"refund": {33"href": "https://api.sandbox.checkout.com/payments/pay_4k4b3jkvgmuexfpiww6nzhf4ru/refunds"34}35}36}
Swish supports both full and partial refunds.
Call the Refund a payment endpoint, and provide the payment_id value you received in the Create a payment response as the {id} path parameter.
If the customer fails to complete their payment within three minutes, you receive a Payment expired webhook.
To set up your test environment you need:
- Credentials to Swish's sandbox environment
- A BankID account – BankID is an electronic identification system, required for all Swish payments.
- The Swish test app
- Contact your account manager or request support to request:
- A test personal identification number
- A test phone number
- A certificate password
- Go to the BankID login page, and select Order personal code.
- You receive a personal code in your email.
- Enter the personal code on the BankID login page to sign in.
- Generate a Mobile BankID using your test PIN from Checkout.com.
- Download the BankID app from your device's app store.
- Update the server from the Android or iOS app settings to configure to test environment:
"cavainternal.test.bankid.com". - Launch the BankID app and scan the QR code on your BankID screen.
- Follow the instructions on the screen to finish setting up BankID.
- Depending on your platform, download the Swish test app from their test distribution platforms:
- Android – Swish in Firebase
- iOS – Swish in TestFlight
- Sign in using the test personal number, phone number, and certificate password provided.
- Select to activate your BankID.
After setting up your test environment, you can send test payment requests, and validate them using your test Swish app.