Swish
Basic information
Customers confirm Swish payments in the Swish app.
- Integration paths: Checkout, Direct API
- Transaction type: One-time web payment
lpmsInfo.lpmsType:SWISH
| Customer country/region | Transaction currency |
|---|---|
| 🇸🇪 SE — Sweden | SEK |
The customer country/region is the billingInformation.country value in the payment request.
Before you begin
Complete Setup, confirm that Swish is enabled for your merchant application, and prepare a server endpoint to receive payment notifications. When building your own method list or restricting payment to one method, query available payment methods for the order context.
The currency listed here is the transaction currency. Confirm your account's transaction limits, settlement currencies, and settlement arrangements with Onerway. See Currency and amount validation for amount formatting.
Create a payment
For Checkout, call Create Checkout Payment with productType=ALL, subProductType=DIRECT, txnType=SALE, and orderCurrency=SEK. To show only Swish, set lpmsInfo.lpmsType to SWISH, sending lpmsInfo as a JSON string. If you omit lpmsInfo, the customer chooses from the methods available for the order. Supply the customer's billing and shipping details according to the API conditions.
Select the request example Unified Checkout with all available payment methods, replace its order and customer details, add lpmsInfo when preselecting Swish, and remove cardInfo for this flow. Save the returned paymentId and transactionId, then redirect the customer's browser to redirectUrl. The response example Unified Checkout session created shows this structure; the initial status=U means the payment is unpaid. See Checkout integration for request authentication and return handling.
For the Direct API, call Create direct transaction with productType=LPMS, subProductType=DIRECT, txnType=SALE, paymentMode=WEB, lpmsInfo.lpmsType=SWISH, and orderCurrency=SEK. Follow the API reference for the complete required fields and authentication requirements.
For the Direct API, select the request example Redirect local payment request (illustrative). Replace Bancontact with SWISH, set orderCurrency=SEK, and supply the customer's actual country and the other required order and billing details. Encode lpmsInfo, billingInformation, and shippingInformation as JSON strings. Include the merchant-collected end-user IP, browser, and device information in txnOrderMsg. Keep product and order currencies consistent, with amounts, discounts, and shipping fees adding up to orderAmount.
Customer action and final result
Save the Direct API response’s paymentId and transactionId. When status=R and actionType=RedirectURL, send the customer to data.redirectUrl; select Redirect local payment response (illustrative) for the response structure. See Local payment integration for response fields and other actions. Use the returned URL without constructing a payment page URL yourself.
For desktop web payments, the customer scans the QR code on the hosted payment page with the Swish app. On the same phone, the customer can continue using the hosted page’s button to open Swish. The customer confirms the payment in the app.
Creating a transaction or returning to the merchant page does not confirm payment success. Read the transaction status from a verified payment result webhook, or use Query transactions to reconcile the result. See Webhooks for verification, acknowledgement, and duplicate handling.
Only status=S confirms payment success; status=F indicates failure. Handle other states according to the API reference.
Refunds and disputes
Confirm refund availability, restrictions, and the applicable dispute process with Onerway for your account. When refunds are enabled, follow Refunds.
Testing and go-live
Confirm the test environment, method enablement, and available test steps with Onerway before following Testing.
Use the Swish sandbox to check page redirection and handling of incomplete payments. Confirm the app and account requirements for successful payment testing with Onerway. Opening a QR code or the app alone does not verify a successful payment.
- Create an order in SEK using an enabled test configuration, and check the method code and returned page.
- Follow the approved test steps for a successful payment. Confirm that the order becomes paid only after a verified notification or server query reports
status=S. - Test abandonment, incomplete payment, and a missing notification. Confirm that returning to the merchant page does not mark the order paid and that queries can reconcile the state.
- Before launch, confirm production enablement, currency, limits, and the notification endpoint. Test refunds if enabled.