- METHOD TYPEReal-Time Bank Transfer
- PAYMENTS
- PAYOUTS
- REFUNDS
- RECURRING
Introduction
Klarna is a global leader in flexible payment solutions. Klarna Debit Risk provides high-risk partners a fast, secure bank transfer product with high acceptance rates via Pay Now.
Supported Countries
- Austria
- Belgium
- Finland
- Germany
- Netherlands
- Spain
- Sweden
- Switzerland
- United Kingdom
Supported Currencies
- CHF
- EUR
- GBP
- SEK
REST API 1.0
Payment Flow
- Generate a
sessionToken. - Perform the payment by sending a
/paymentrequest with the following mandatory parameters:
-
userTokenIdamountcurrencypaymentOption.alternativePaymentMethodclass containing:paymentMethod: “apmgw_Sofort”
deviceDetailsclass containing:-
ipAddress
-
Example /payment Request
{
"sessionToken":"<sessionToken from /getSessionToken>",
"merchantId":"<your merchantId>",
"merchantSiteId":"<your merchantSiteId>",
"clientRequestId":"<unique request ID in merchant system>",
"amount":"200",
"currency":"EUR",
"userTokenId":"<unique customer identifier in merchant system>",
"clientUniqueId":"<unique transaction ID in merchant system>",
"paymentOption":{
"alternativePaymentMethod":{
"paymentMethod":"apmgw_Sofort"
}
},
"deviceDetails":{
"ipAddress":"<customer's IP address>"
},
"billingAddress":{
"firstName":"John",
"lastName":"Smith",
"country":"DE",
"email":"[email protected]"
},
"userDetails":{
"firstName":"John",
"lastName":"Smith",
"country":"DE",
"email":"[email protected]"
},
"timeStamp":"<YYYYMMDDHHmmss>",
"checksum":"<calculated checksum>"
}
The response returns a redirectUrlto redirect the customer to the payment page, as well as a userPaymentOptionId (UPO) for use in future transactions.
Example /payment Response
{
"orderId":"341413598",
"userTokenId":"Usertoken01",
"paymentOption":{
"redirectUrl":"https://apitest.nuvei.com/Home?PaymentToken=F355F191C8B97D1D3B8453B283258C66.13560826",
"userPaymentOptionId":"83246818"
},
"transactionStatus":"REDIRECT",
"sessionToken":"f43d774a-a180-4935-bbc1-1315bb4dc203",
"internalRequestId":549917488,
"status":"SUCCESS",
"errCode":0,
"reason":"",
"merchantId":"2439523627382132721",
"merchantSiteId":"224428",
"version":"1.0",
"clientRequestId":"20221104131500"
}
After the transaction is processed, Nuvei sends a Direct Merchant Notification (DMN) that includes the result of the transaction to the URL provided in urlDetails.notificationUrl, which Nuvei recommends including in the /payment request.
Payout Flow
Perform a/payout via the following options:- Use the “apmgw_Sofort” UPO to process the
/payout. - Collect account details from the deposit and use them with another supported payment method, including ‘SEPA Payouts’.
- For example, use the IBAN received in the DMN to create a ‘SEPA Payouts’
/payoutrequest.
- For example, use the IBAN received in the DMN to create a ‘SEPA Payouts’
- Register a
userTokenId.
- Create a UPO by sending an
/addUPOAPMrequest that includes the following parameter:- “apmgw_Sofort”
- Send a
/payoutrequest and include theuserPaymentOptionId(UPO), which contains the user’s previously stored APM account details.
After the transaction is processed, Nuvei sends a DMN that includes the result of the transaction tourlDetails.notificationUrl, which Nuvei recommends including in the/payoutrequest.
REST API 2.0
Payment Flow
- Perform the payment by sending a
/paymentsrequest with the following mandatory parameters:
-
amountcurrencypaymentOption.aleternativePaymentMethodclass containing:name: “klarnaDebitRisk”
deviceDetailsclass containing:ipAddress
buyerDetails.billingAddressclass containing:countryCode
buyerDetailsclass containing:buyerIdfirstNamelastNameemail
Example /payments Request
{
"processingEntityId": "<<processing entity id>>",
"amount": 12,
"currency": "EUR",
"transactionType": "Sale",
"paymentOption": {
"alternativePaymentMethod": {
"name": "klarnaDebitRisk"
}
},
"custom": {
"description": "Some description"
},
"deviceDetails": {
"deviceType": "desktop",
"deviceName": "iPhone 5s",
"deviceOS": "iOs 10.2",
"ipAddress": "192.168.2.38"
},
"buyerDetails": {
"buyerId": "JohnSmith123",
"firstName": "John",
"lastName": "JSmith",
"companyName": "Nuvei Corp",
"locale": "bg-BG",
"dateOfBirth": "1978-01-01",
"email": "[email protected]",
"phone": "+1234567889",
"billingAddress": {
"address": "30 Alenbi st",
"zip": "1234",
"city": "Berlin",
"countryCode": "DE",
"phone": "+1234567889",
"addressMatch": true
},
"shippingAddress": {
"sameAsBilling": true,
"address": "30 Alenbi st",
"zip": "1234",
"city": "Berlin",
"countryCode": "DE",
"phone": "+1234567889"
}
}
}
The response returns a redirect URL to redirect the customer to the payment page as well as a payment token paymentTokenId for use in future transactions.
Example /payments Response
{
"paymentId": "a26e7096e4ce4a64ba7ad2cd7314f740",
"amount": 12,
"currency": "EUR",
"transactionType": "Sale",
"result": {
"status": "redirect"
},
"redirectUrl": "https://www.directebanking.com/payment/start?...",
"paymentOption": {
"alternativePaymentMethod": {
"name": "klarnaDebitRisk",
"paymentTokenId": "d18dce0f16a84bfeb5f35d2acf5873e0"
}
}
}
After the transaction is processed, Nuvei sends a webhook (DMN) that includes the result of the transaction to the URL provided in urlDetails.webhookUrl, which Nuvei recommends including in the /payments request.
Payout Flow
Submit a /payouts request with one of the following parameters:
paymentOption.alternativePaymentMethodpaymentOption.alternativePaymentMethodclass containing:name: “klarnaDebitRisk”
Example Request
{
"processingEntityId": "123e4567-e89b-12d3-a456-426614174000",
"amount": 60,
"currency": "EUR",
"paymentOption": {
"alternativePaymentMethod": {
"name": "klarnaDebitRisk"
}
},
"buyerDetails": {
"buyerId": "buyerId123",
"firstName": "John",
"lastName": "JSmith",
"companyName": "Nuvei Corp",
"locale": "bg-BG",
"dateOfBirth": "1978-01-01",
"email": "[email protected]",
"phone": "+1234567889",
"billingAddress": {
"state": "TX",
"city": "Austin",
"zip": "78652",
"countryCode": "US"
},
"shippingAddress": {
"sameAsBilling": true
}
}
}
Initiating Payout via paymentTokenId
Use paymentToken.paymentTokenId to perform the /payouts using a previously stored alternativePaymentMethod account.
Example /payouts Request via paymentTokenId
{
"processingEntityId": "123e4567-e89b-12d3-a456-426614174000",
"amount": 60,
"currency": "EUR",
"paymentOption": {
"paymentToken": {
"paymentTokenId": "abc123def456ghi789jkl012mno345pq"
}
},
"buyerDetails": {
"buyerId": "buyerId123",
"firstName": "John",
"lastName": "JSmith",
"companyName": "Nuvei Corp",
"locale": "bg-BG",
"dateOfBirth": "1978-01-01",
"email": "[email protected]",
"phone": "+1234567889",
"billingAddress": {
"state": "TX",
"city": "Austin",
"zip": "78652",
"countryCode": "US"
},
"shippingAddress": {
"sameAsBilling": true
}
}
}
After the transaction is processed, Nuvei sends a webhook that includes the result of the transaction to the URL provided in urlDetails.webhookUrl, which Nuvei recommends including in the /payouts request in order to receive asynchronous notifications.
User Experience
-
- The user is redirected to Klarna. The user confirms the payment details and selects Pay with Klarna.

- The user signs in to the online banking application.

- The user provides the one-time password (OTP) and confirms the payment.

- If the user entered the correct details, the transaction is complete and the merchant receives a notification with the success status.
The customer is redirected to the merchant return URL.

- The user is redirected to Klarna. The user confirms the payment details and selects Pay with Klarna.
Testing
To test the Klarna Pay Now payment method successfully, use the following test data.
| Data | Value |
|---|---|
| Email for Austria: | Approved: [email protected] Denied: [email protected] |
| Email for Germany: | Approved: [email protected] Denied: [email protected] |
| Email for United Kingdom: | Approved: [email protected] Denied: [email protected] |
| First Name: | Enter any name. Example: Doe |
| Last Name: | Enter any name. Example: Test |
| Phone Number for Austria: | Approved: +4306762600456 Denied: +4306762600745 |
| Phone Number for Germany: | Approved: +49017614284340 Denied: +49017610927312 |
| Phone Number for United Kingdom: | Approved: +447755564318 Denied: +447355505530 |
| City | Enter any city. Example: London |
| Street | Enter any street. Example: Great Russell |
| Zip Code | Enter any valid zip code. Example: WC1B 3DG |
| Date of Birth | Enter any date. |
| Available countries: | AT, DE, GB |