Recurring Payments

This guide covers everything you need to know to integrate Swish recurring payments through the Ping Payments API.

Swish recurring payments allow you to charge a customer repeatedly without requiring them to confirm each individual payment in the Swish app. The customer gives consent once, and subsequent payments are charged automatically against that consent.

Supported Currency

SEK — Swish only supports Swedish Krona.

Overview

Recurring payments are a two-step process:

  1. Create a consent — The customer authorizes recurring payments by signing a consent via the Swish app (using BankID).
  2. Charge against the consent — Once the consent is active, you can initiate payments against it without further customer interaction.

Step 1: Create a Payment Consent

Before charging a customer, you must first create a payment consent. The consent signing can use either the e-commerce or m-commerce flow.

E-Commerce Consent Flow

The customer provides their phone number and personal identity number (TIN). A push notification is sent to their Swish app to sign the consent.

Required Parameters

ParameterTypeDescription
tinstringPersonal identity number (personnummer) of the payer. 12 digits.
phone_numberstringSwish-connected phone number of the payer

M-Commerce Consent Flow

The customer provides their personal identity number. The consent can be signed via a deep link or QR code — no phone number is needed upfront.

Required Parameters

ParameterTypeDescription
tinstringPersonal identity number (personnummer) of the payer. 12 digits.

Optional Parameters (M-Commerce only)

ParameterTypeDefaultDescription
use_qr_codebooleanfalseGenerate a QR code for the consent signing
qr_formatstring"transparent_svg"QR code image format. One of: transparent_svg, transparent_png, solid_jpg, solid_svg, solid_png
qr_sizeinteger300QR code image size in pixels. Minimum 300
qr_borderinteger1QR code border size in pixels. Range: 14

Consent Signing Flow

  1. Initiate a payment consent with provider: "swish" and flow: "e_commerce" or "m_commerce".
  2. E-Commerce: Customer receives a push notification in the Swish app and signs the consent with BankID.
  3. M-Commerce: Customer scans the QR code or follows the deep link, then signs the consent with BankID.
  4. Once the consent reaches ACTIVE status, it can be used to charge payments.

Consent Statuses

StatusDescription
INITIATEDConsent request has been created
PENDINGCustomer is in the process of signing
ACTIVEConsent is active and can be used for payments
ABORTEDCustomer did not sign in time
DECLINEDCustomer declined the consent
REVOKEDConsent has been revoked

Step 2: Initiate a Recurring Payment

Once you have an active consent, you can charge payments against it. Recurring payments do not require the customer to confirm in the Swish app — they are processed automatically.

Required Parameters

ParameterTypeDescription
consent_idstring (uuid)The Ping Payments payment consent ID (returned when the consent was created)
messagestringMessage associated with the payment. Max 50 characters. Same character restrictions as commerce payments.

Example Request

{
  "currency": "SEK",
  "method": "recurring",
  "order_items": [
    {
      "amount": 9900,
      "merchant_id": "{{merchantId}}",
      "name": "Monthly subscription"
    }
  ],
  "provider": "swish",
  "total_amount": 9900,
  "provider_method_parameters": {
    "consent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "message": "Subscription Feb 2025"
  }
}

Example Response

{
  "id": "25d55ad2-8395-4b73-8c0e-1a2b3c4d5e6f"
}

The recurring payment response contains no additional provider_method_response fields. The payment is processed automatically against the consent.


Refunds

Swish recurring payments support refunds through the standard Ping Payments refund flow, identical to commerce payment refunds.