REST API Swish

The swedish payment method Swish is one of the most popular payment methods in Sweden. More than half of the population uses the app on their cell phones. Originally Swish was a joint venture project of the most popular swedish banks as a pure P2P-payment method. Since 2017 it is also available for E-Commerce and POS. If you want to pay, you can either do it via scan of a QR-code or the submission of your mobile or swish number.


Get started

To enable Swish for your merchant account, first you require to obtain the certificate from Swish. Follow the below steps to provision your Swish certificate:

  1. Obtain access to Swish certificate management tool. For more details refer to Swish's documentation.

  2. Contact the NEXI Helpdesk to request a Certificate Signing Request (CSR).

  3. NEXI will generate the CSR and send it to you.

  4. Upload the received CSR to the Swish Certificate Management Tool.

  5. Generate and download the certificate as per instructions (section 2.6 in Swish documentation). Accepted formats: PEM or PKCS#7.

  6. Reply to the CSR email from NEXI with the downloaded certificate attached.

Once your certificate has been processed, NEXI will enable Swish for your MID.


Integration options

Swish is supported via Direct Integration only.

Unlike typical Direct integration, Swish follows a custom integration flow. Refer to the detailed instructions below to implement it correctly.


Process flow

  1. Customer proceeds to checkout with Swish.

  2. Your frontend calls your server to continue with Swish payment. 

  3. Your server makes a Create payment call with: 

    "paymentMethods": {
      "type": "SWISH",
      "integrationType": "DIRECT"
    }
    
  4. NEXI Paygate initiates payment request to Swish.

  5. Swish returns the necessary information to be able to orchestrate customer confirmation flow via Swish app on the frontend.

  6. NEXI Paygate returns the response to your server. providerToken is available only for payments made via APP (channel=APP).

  7. Your server orchestrates the flow of customer confirmation on the Swish app.

  8. Customer confirms payment on the Swish app.

  9. NEXI Paygate receives Complete payment confirmation.

  10. NEXI Paygate notifies to the urls.notify that was submitted in the initial request with payId in the notification body.

  11. Your server makes a Retrieve payment details by Payment ID call with the payId to retrieve the responseCode of the payment.

  12. NEXI Paygate responds with the responseCode of the payment along with other parameters.

  13. Your server returns a success or a failure page based on the responseCode of the payment.


Reverse payment

If a Swish payment needs to be canceled before it is settled, you can initiate a reversal.

To reverse a Swish payment, use the Reverse payment endpoint and submit the original payId.

Refund payment

Swish supports refunds after a successful and settled payment.

To process a refund, call the Refund payment endpoint with the original payId.