Payment-method icon

Swish for API only

Add Swish to your API-only integration.

You can add Swish to your existing integration. The following instructions show only what you must add to your integration specifically for Swish.

If an instruction on this page corresponds with a step in the main integration guide, it includes a link to that corresponding step of the main integration guide.

Requirements

Requirement Description
Integration type Make sure that you have an existing API-only integration.
Action handling Make sure that your existing integration is set up to handle the additional action.
action.type: qr.
Setup steps Before you begin, add Swish in your Customer Area.

How it works

  1. The shopper selects Swish as the payment method.
  2. The shopper enters their details in the payment form that you build.
  3. When you make the payment request, you include additional information about the items that the shopper intends to purchase.
  4. Handle the additional actions:
    • For shoppers on desktop or laptop, present a QR code.
    • For shoppers on mobile, present a button that redirects to the Swish app.
    • For shoppers on tablet, you can present a QR code or a button that redirects to the Swish app, or both.
  5. You fulfill the order by sending items to the shopper.

Build your payment form

Include Swish in the list of available payment methods.

You do not need to collect any information from the shopper in your payment form.

You can download the logo for Swish to use in your form.

Get Swish as an available payment method

When you make the /paymentMethods to get available payment methods, specify the following so that Swish is included in the response.

Parameter Values
countryCode SE
amount.currency SEK

Add additional parameters to your /payments request

You do not need to add any parameters when you make a payment.

When the shopper is on desktop or laptop, the /payments response includes action.type : qrCode. Part of handling this action type is to show the QR code to the shopper.

When the shopper is on mobile, the /payments response includes action.type : redirect. Part of handling this action type is to redirect the shopper to the Swish app.

Test and go live

When you make a Swish payment in the test environment, the payment is authorised within 15 seconds. You can simulate different refusal scenarios, as outlined in the Merchant Swish Simulator, by adding the error code to the shopperStatement property. For example, "shopperStatement": "FF08".

Check the status of Swish test payments in your Customer Area > Transactions > Payments.

To accept live Swish payments, you must submit a request for Swish in your live Customer Area.

See also