On this page
No Headings
Last updated: June 17, 2026
Before you onboard Swish, verify you have completed the following PayPal integration steps:
Sign up for a PayPal developer account. On successful signup, PayPal automatically creates your sandbox environment. The sandbox environment mimics real-world transactions and includes both business and personal accounts by default. Use the personal account to approve payments and the business account to receive money. You can create additional business and personal accounts as needed.
Configure a webhook listener for the app and subscribe to events:
The webhook listener is now configured, and a Webhook ID is displayed. Store the ID for verification in your app code. For more information, see Use webhooks.
After you complete your PayPal account setup, enable Swish as a payment method.
You can enable Swish using one of the following methods:
If you have an eligible PayPal business account, you can enable Swish directly from your dashboard:
After enabling, go to Payment Options to manage your Swish settings.
If you don't see Swish in your dashboard, request approval by visiting the links below:
Swish payments are activated after PayPal verifies eligibility and completes a compliance review.
Create an order to begin the Swish payment process. You can configure the order by following these steps:
/v2/checkout/orders endpoint with one of the following configurations:
Use this flow for desktop browsers where buyers scan a QR code with their mobile device. Use a valid access token and make the POST call to /v2/checkout/orders endpoint with request body parameters including intent set to CAPTURE, purchase_units with amount and currency_code, payment_source.swish object, and the PayPal-Request-Id header for idempotency.
Set processing_instruction to ORDER_COMPLETE_ON_PAYMENT_APPROVAL. Funds are captured immediately after buyer approval.
curl -v -L -s -X POST https://api.paypal.com/v2/checkout/orders \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Request-Id: UNIQUE-REQUEST-ID' \
-d '{
"intent": "CAPTURE",
"processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL",
"payment_source": {
"swish": {
"name": "Jhon Doe",
"country_code": "SE",
"experience_context": {
"locale": "sv-SE",
"return_url": "http://www.bing.com",
"cancel_url": "http://www.google.com"
}
}
},
"payer": {
"email_address": "[email protected]",
"first_name": "John1",
"last_name": "Doe1",
"country_code": "SE",
"phone": {
"phone_type": "MOBILE",
"phone_number": {
"national_number": "1238712837"
}
}
},
"purchase_units": [
{
"invoice_id": "Invoice-123456",
"custom_id": "Custom-12345",
"amount": {
"currency_code": "SEK",
"value": "100"
}
}
]
}'After receiving the response, redirect the buyer to complete payment approval. The payment captures automatically after buyer approval.
For manual capture, exclude the processing_instruction parameter or set it to NO_INSTRUCTION. When the buyer approves the payment, capture the payment to complete the transaction.
curl -v -L -s -X POST https://api.paypal.com/v2/checkout/orders \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Request-Id: UNIQUE-REQUEST-ID' \
-d '{
"intent": "CAPTURE",
"payment_source": {
"swish": {
"name": "Jhon Doe",
"country_code": "SE",
"experience_context": {
"locale": "sv-SE",
"return_url": "http://www.bing.com",
"cancel_url": "http://www.google.com"
}
}
},
"payer": {
"email_address": "[email protected]",
"first_name": "John1",
"last_name": "Doe1",
"country_code": "SE",
"phone": {
"phone_type": "MOBILE",
"phone_number": {
"national_number": "1238712837"
}
}
},
"purchase_units": [
{
"invoice_id": "Invoice-123456",
"custom_id": "Custom-12345",
"amount": {
"currency_code": "SEK",
"value": "100"
}
}
]
}'After receiving the response, redirect the buyer to complete payment approval, then capture the payment after buyer approval.
Use this flow for mobile browsers where buyers switch to the Swish app on the same device. Use a valid access token and make the POST call to /v2/checkout/orders with request body parameters including intent set to CAPTURE, purchase_units with amount and currency_code, payment_source.swish object with country_code set to SE and redirect_to_app set to true, and the PayPal-Request-Id header for idempotency.
Set processing_instruction to ORDER_COMPLETE_ON_PAYMENT_APPROVAL. Funds are captured immediately after buyer approval.
curl -v -L -s -X POST https://api.paypal.com/v2/checkout/orders \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Request-Id: UNIQUE-REQUEST-ID' \
-d '{
"intent": "CAPTURE",
"processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL",
"payment_source": {
"swish": {
"name": "Jhon Doe",
"country_code": "SE",
"experience_context": {
"locale": "sv-SE",
"return_url": "http://www.bing.com",
"redirect_to_app": true
}
}
},
"payer": {
"email_address": "[email protected]",
"first_name": "John1",
"last_name": "Doe1",
"country_code": "SE",
"phone": {
"phone_type": "MOBILE",
"phone_number": {
"national_number": "1238712837"
}
}
},
"purchase_units": [
{
"invoice_id": "Invoice-123456",
"custom_id": "Custom-12345",
"amount": {
"currency_code": "SEK",
"value": "100"
}
}
]
}'After receiving the response, redirect the buyer to complete payment approval. The payment captures automatically after buyer approval.
For manual capture, exclude the processing_instruction parameter or set it to NO_INSTRUCTION. When the buyer approves the payment, capture the payment to complete the transaction.
curl -v -L -s -X POST https://api.paypal.com/v2/checkout/orders \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Request-Id: UNIQUE-REQUEST-ID' \
-d '{
"intent": "CAPTURE",
"payment_source": {
"swish": {
"name": "Jhon Doe",
"country_code": "SE",
"experience_context": {
"locale": "sv-SE",
"return_url": "http://www.bing.com",
"redirect_to_app": true
}
}
},
"payer": {
"email_address": "[email protected]",
"first_name": "John1",
"last_name": "Doe1",
"country_code": "SE",
"phone": {
"phone_type": "MOBILE",
"phone_number": {
"national_number": "1238712837"
}
}
},
"purchase_units": [
{
"invoice_id": "Invoice-123456",
"custom_id": "Custom-12345",
"amount": {
"currency_code": "SEK",
"value": "100"
}
}
]
}'After receiving the response, redirect the buyer to complete payment approval, then capture the payment after buyer approval.
| Parameter name | Description |
|---|---|
processing_instructionstring | Specifies how the order is processed. For automatic capture, set to ORDER_COMPLETE_ON_PAYMENT_APPROVAL. For manual capture, exclude this parameter or set to NO_INSTRUCTION. |
intentRequired, string | Indicates whether payment is captured immediately or authorized for later capture. For Swish payments, set to CAPTURE. |
purchase_unitsRequired, array | Lists the items or services the buyer is purchasing in the order. |
purchase_units.amountRequired, object | Amount of the order and the currency code. For Swish payments, use SEK currency. |
payment_sourceRequired, object | Payment method used to fund the order. For Swish payments, include a swish object with buyer and experience context information. |
payment_source.swish.country_codeRequired, string | Country code required for Swish payments, specified in the ISO 3166-1 format. For Swish payments, set to SE. |
payment_source.swish.nameRequired, object | Name of the buyer. |
payment_source.swish.experience_contextobject | Context information for the Swish payment experience including locale, return URL, and buyer flow settings. |
payment_source.swish.experience_context.localestring | Locale for buyer's payment experience. For Swish payments, set to sv-SE. |
payment_source.swish.experience_context.return_urlRequired, string | URL to redirect the buyer after payment approval. |
payment_source.swish.experience_context.cancel_urlRequired, string | URL to redirect the buyer if they cancel the payment. |
payment_source.swish.experience_context.redirect_to_appboolean | Indicates whether to use mobile app switch flow. Set to true for mobile app switch. Omit or set to false for QR code flow.Default is false. |
After creating an order, redirect the buyer to complete payment approval in the Swish app. The redirect method depends on your integration pattern and the buyer's device.
For PayPal-hosted integration, redirect the buyer to PayPal's payment page using the payer-action link from the order response.
payer-action link from the order creation response.PayPal handles the buyer experience and redirects the buyer back to your return_url after payment approval or to your cancel_url if the buyer cancels.
For Merchant-hosted integration, display the QR code from the order response on your own page.
qr_details.qr_image in the order response.For mobile app switch flow with merchant-hosted integration, you can redirect using the payer-action link to trigger the Swish app directly.
After the buyer approves payment:
For manual capture orders, call the capture endpoint after the buyer approves the payment. Use a valid access token and make the POST call to /v2/checkout/orders/{order_id}/capture endpoint to capture the authorized funds.
curl -v -L -s -X POST https://api.paypal.com/v2/checkout/orders/5SJ83317D1020641R/capture \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Request-Id: UNIQUE-REQUEST-ID'After creating the order, you can track the payment status in two ways:
Note: Use webhooks for real-time updates and poll the order status only if you cannot receive webhooks.
To track the payment status using webhooks, follow these steps:
Subscribe to webhook events in your PayPal developer dashboard or through the Webhooks API. For example:
PAYMENT.CAPTURE.COMPLETED – Successful payment capturePAYMENT.CAPTURE.DENIED – Failed payment captureDefine a webhook handler in your server-side application to:
1. Listen for incoming webhook events.
2. Confirm receipt of the event to PayPal.
3. Verify the source of the event notification.
4. Complete further actions based on event data.
Note: If needed, use the List event notifications API to retrieve all webhook events or the Show event notification details API to get specific event details.
Extract the order ID from the "rel": "up" link in the webhook payload's resource.links array to correlate the capture to your original order.
Note: Be aware of PayPal's API rate limits when polling for order status. For best practices and details, see the Rate limiting guideline.
To check the status of an order, you can poll the Orders API:
/v2/checkout/orders/{id} endpoint, replacing {id} with the order ID from your Create order response.| Parameter name | Description |
|---|---|
id | Unique order ID. |
status | Current status of the order. |
purchase_units | List of purchase units for the order, including amount and currency. |
payer | Information about the buyer, including name and payer ID. |
For the comprehensive list of response parameters, see Show order details.
After a successful payment, notify the buyer of a successful transaction. You can do this by sending a confirmation email.