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:
- Create a consent — The customer authorizes recurring payments by signing a consent via the Swish app (using BankID).
- 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
| Parameter | Type | Description |
|---|---|---|
tin | string | Personal identity number (personnummer) of the payer. 12 digits. |
phone_number | string | Swish-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
| Parameter | Type | Description |
|---|---|---|
tin | string | Personal identity number (personnummer) of the payer. 12 digits. |
Optional Parameters (M-Commerce only)
| Parameter | Type | Default | Description |
|---|---|---|---|
use_qr_code | boolean | false | Generate a QR code for the consent signing |
qr_format | string | "transparent_svg" | QR code image format. One of: transparent_svg, transparent_png, solid_jpg, solid_svg, solid_png |
qr_size | integer | 300 | QR code image size in pixels. Minimum 300 |
qr_border | integer | 1 | QR code border size in pixels. Range: 1–4 |
Consent Signing Flow
- Initiate a payment consent with
provider: "swish"andflow: "e_commerce"or"m_commerce". - E-Commerce: Customer receives a push notification in the Swish app and signs the consent with BankID.
- M-Commerce: Customer scans the QR code or follows the deep link, then signs the consent with BankID.
- Once the consent reaches
ACTIVEstatus, it can be used to charge payments.
Consent Statuses
| Status | Description |
|---|---|
INITIATED | Consent request has been created |
PENDING | Customer is in the process of signing |
ACTIVE | Consent is active and can be used for payments |
ABORTED | Customer did not sign in time |
DECLINED | Customer declined the consent |
REVOKED | Consent 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
| Parameter | Type | Description |
|---|---|---|
consent_id | string (uuid) | The Ping Payments payment consent ID (returned when the consent was created) |
message | string | Message 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.
Updated 6 days ago