Klarna Debit Risk
Beta
Last updated: February 19, 2025
Information
Klarna is also available through Flow. Flow enables you to accept payments on your website using Checkout.com's global network of payment methods with a single integration.
Klarna Debit Risk is a pay-by-bank payment method that Klarna offers for restricted segments. This specialized product enables high-risk segments to accept Klarna's customer base with a bank-transfer solution.
To check if you're eligible for Klarna Debit Risk, contact your Account Manager or [email protected].
With Klarna Debit Risk, the customers skip Klarna's payment selection screen and proceed directly with Pay by Bank.
Klarna Debit Risk is available in:
- Austria
- Belgium
- Germany
- Netherlands
- Spain
- Sweden
- Switzerland
- United Kingdom
Information
To enable Klarna payments on your account, contact your Account Manager or [email protected].
Model | Collecting |
---|---|
Payment flow | Direct |
Auto capture | |
Manual capture | |
Refund | Full and partial refund |
Void | |
Disputes |
Information
Klarna is also available through Flow. Flow enables you to accept payments on your website using Checkout.com's global network of payment methods with a single integration.
To accept Klarna Debit Risk payments:
- Request a payment context.
- Configure Klarna's JavaScript SDK.
- Authorize the session.
Optionally, you can verify if Klarna approved the payment context. - Request a payment.
To display the Klarna widget on the checkout page, you must request a Checkout.com payment context. The payment context will return a session_id
and client_token
, which you'll need to provide in later requests.
Information
The Payment Contexts API supports idempotency. You can safely retry API requests without the risk of duplicate requests.
post
https://api.checkout.com/payment-contexts
1{2"currency": "EUR",3"amount": 1000,4"source": {5"type": "klarna",6"account_holder": {7"billing_address": {8"country": "DE"9}10}11},12"items": [13{14"name": "Battery Power Pack",15"quantity": 1,16"unit_price": 1000,17"total_amount": 1000,18"reference": "BA67A"19}20],21"processing": {22"locale": "en-GB"23},24"processing_channel_id": "{pc_xxxx}"25}
You must provide the items[]
array when you request a Klarna payment context. The value of items[].reference
is the reference shown to your customer in the Klarna application when confirming the payment.
For the full API specification, see the API reference.
You must provide the items[]
array when you request a Klarna payment context. The value of items[].reference
is the reference shown to your customer in the Klarna app when confirming the payment.
If you receive a 201 Created
response code, your request was successful.
A successful request will contain the following fields in the response's partner_metadata
object:
session_id
client_token
1{2"id": "pct_jwvjl5tin54ubn7x2stvmunske",3"partner_metadata": {4"session_id": "kcs_55xomnyd3ftujckeoyuvtkx2ue",5"client_token": "eyJhbGciOiJub25lIn0.ewogICJzZXNzaW9uX2lkIiA6ICI1MGEzYTNiOS02NGE5LTYwNjMtODNmNC1hMzRlM2Q4MjRiNGIiLAogICJiYXNlX3VybCIgOiAiaHR0cHM6Ly9rbGFybmEtcGF5bWVudHMtZXUucGxheWdyb3VuZC5rbGFybmEuY29tIiwKICAiZGVzaWduIiA6ICJrbGFybmEiLAogICJsYW5ndWFnZSIgOiAiZW4iLAogICJwdXJjaGFzZV9jb3VudHJ5IiA6ICJHQiIsCiAgImFuYWx5dGljc19wcm9wZXJ0eV9pZCIgOiAiVUEtMzYwNTMxMzctMTEiLAogICJ0cmFjZV9mbG93IiA6IGZhbHNlLAogICJlbnZpcm9ubWVudCIgOiAicGxheWdyb3VuZCIsCiAgIm1lcmNoYW50X25hbWUiIDogIlBsYXlncm91bmQgRGVtbyBNZXJjaGFudCIsCiAgInNlc3Npb25fdHlwZSIgOiAiUEFZTUVOVFMiLAogICJjbGllbnRfZXZlbnRfYmFzZV91cmwiIDogImh0dHBzOi8vZXZ0LnBsYXlncm91bmQua2xhcm5hLmNvbSIKfQ."6},7"_links": {8"self": {9"href": "https://api.checkout.com/payment-contexts/pct_jwvjl5tin54ubn7x2stvmunske"10}11}12}
The Klarna JavaScript SDK enables you to display the Klarna widget in your site:
- Add the Klarna script to your web application.
1<script src="https://x.klarnacdn.net/kp/lib/v1/api.js" async></script>
- Initialize the Klarna SDK with the
client_token
received in thepayment_context
response.
1window.klarnaAsyncCallback = function () {2Klarna.Payments.init({3client_token:"eyJhbGciOiJub...",4});5};
Note
client_token
relies on the Klarna session created with the payment context request. The payment context request expires after 48 hours, after which payments might fail.
- Place a container on your page to render Klarna as a payment option.
1<div id="klarna-payments-container"></div>
- Load the Klarna widget in the placeholder.
1Klarna.Payments.load(2{3container: '#klarna-payments-container'4},5{},6function (res) {7console.debug(res);8}9)
Information
For a better user experience, call load()
when you load your checkout page. This ensures that the container for Klarna payments loads immediately in a hidden container, and is ready to display when needed.
For more information, see Klarna Docs:
You must call the authorization endpoint only once. The authorization token is then valid for 60 minutes.
When the customer selects to pay with Klarna, open the Klarna pop-up and authorize the session. To provide a seamless checkout experience, ensure you send the billing and shipping parameters:
1Klarna.Payments.authorize(2{},3{4billing_address: {5given_name: "Alice",6family_name: "Test",7email: "[email protected]",8street_address: "Södra Blasieholmshamnen 2",9postal_code: "11 148",10city: "Stockholm",11phone: "+46701740615",12country: "SE",13},14shipping_address: {15given_name: "Alice",16family_name: "Test",17email: "[email protected]",18street_address: "Södra Blasieholmshamnen 2",19postal_code: "11 148",20city: "Stockholm",21phone: "+46701740615",22country: "SE",23},24customer: {25date_of_birth: "1941-03-21",26},27},28function (res) {29console.log("Authorize outcome:", res);30}31)
There are two potential cases that you need to handle based on the response:
- Success response
show_form: true
– Klarna performed a pre-assessment and authorized the purchase. You receive apayment_context_approved
webhook. Once the payment context is approved, the approval is valid for 60 minutes. - Error response
show_form: false
– Klarna performed a pre-assessment and didn't authorize the purchase. You cannot offer Klarna as a payment option and need to hide it for the customer at checkout. The customer must select another payment method.
Once the customer confirms payment in the Klarna pop-up, you receive a payment_context_approved
webhook.
Optionally, you can verify if Klarna approved the payment context by calling the Get payment context endpoint to verify its status
:
get
https://api.checkout.com/payment-contexts/{id}
1{2"status": "Approved",3"payment_request": {4"source": {5"type": "klarna",6"account_holder": {7"first_name": "Bose",8"last_name": "Gold",9"date_of_birth": "1990-10-12",10"email": "[email protected]",11"billing_address": {12"address_line1": "654 Main St.",13"country": "US",14"state": "OH"15},16"phone": {17"country_code": "",18"number": ""19},20"identification": {21"number": ""22},23"company_name": "Checkout.com"24}25},26"amount": 1000,27"currency": "EUR",28"shipping": {29"company_name": "Checkout.com",30"first_name": "Test",31"last_name": "Account",32"address": {33"address_line1": "Von-Reiche-Straße 9",34"address_line2": "6th floor",35"zip": "63930",36"city": "Furth",37"country": "DE"38},39"phone": {40"country_code": "+353",41"number": "6789010"42}43},44"items": [45{46"name": "Battery Power Pack",47"quantity": 1,48"unit_price": 1000,49"tax_rate": 0,50"total_amount": 1000,51"tax_amount": 0,52"reference": "BA67A",53"url": "https://product.url.com",54"image_url": "https://image.url.com"55}56],57"processing": {58"locale": "en-IE",59"tax_amount": 0,60"custom_payment_method_ids": [61"6m_149APR",62"6m_0APR",63"12m_149APR",64"12m_0APR",65"24m_149APR",66"24m_0APR"67]68}69},70"partner_metadata": {71"session_id": "kcs_55xomnyd3ftujckeoyuvtkx2ue",72"client_token": "eyJhbGciOiJub25lIn0.ewogICJzZXNzaW9uX2lkIiA6ICI1MGEzYTNiOS02NGE5LTYwNjMtODNmNC1hMzRlM2Q4MjRiNGIiLAogICJiYXNlX3VybCIgOiAiaHR0cHM6Ly9rbGFybmEtcGF5bWVudHMtZXUucGxheWdyb3VuZC5rbGFybmEuY29tIiwKICAiZGVzaWduIiA6ICJrbGFybmEiLAogICJsYW5ndWFnZSIgOiAiZW4iLAogICJwdXJjaGFzZV9jb3VudHJ5IiA6ICJHQiIsCiAgImFuYWx5dGljc19wcm9wZXJ0eV9pZCIgOiAiVUEtMzYwNTMxMzctMTEiLAogICJ0cmFjZV9mbG93IiA6IGZhbHNlLAogICJlbnZpcm9ubWVudCIgOiAicGxheWdyb3VuZCIsCiAgIm1lcmNoYW50X25hbWUiIDogIlBsYXlncm91bmQgRGVtbyBNZXJjaGFudCIsCiAgInNlc3Npb25fdHlwZSIgOiAiUEFZTUVOVFMiLAogICJjbGllbnRfZXZlbnRfYmFzZV91cmwiIDogImh0dHBzOi8vZXZ0LnBsYXlncm91bmQua2xhcm5hLmNvbSIKfQ."73}74}
If status
is returned as Approved
, Klarna has authorized this purchase and you can request the payment.
post
https://api.checkout.com/payments
1{2"payment_context_id": "pct_xxx",3"processing_channel_id": "pc_xxx"4}
Your request was successful if you receive a 202 Success
response code with a status
field set to Pending
.
1{2"id": "pay_mnnf6wnp7fdupa2jechtgg5cr4",3"status": "Pending",4"payment_type": "Installment",5"payment_plan": {6"financing": true7},8"processing": {9"partner_order_id": "dc3b8712-123a-45ef-bc3d-b356a158b31b",10"partner_fraud_status": "ACCEPTED"11},12"_links": {13"self": {14"href": "https://api.sandbox.checkout.com/payments/pay_mnnf6wnp7fdupa2jechtgg5cr4"15}16}17}
When we you send us the payment request:
- We run syntax validation and compliance checks on the payment data.
- If all checks are successful, we set the payment status to
pending
and send your request to Klarna.- If unsuccessful, we set the payment status to
declined
.
- If unsuccessful, we set the payment status to
- Once Klarna confirms they sent the request to the bank, we move the payment to
capture pending
and send youpayment_capture_pending
webhook notification. - If and when Klarna confirms they received the funds from the customer bank, we move the payment to
captured
and send you apayment_captured
webhook notification.- If and when Klarna closes the transaction because they did not receive the funds from the customer's bank, we move the payment to
declined
and send you apayment_capture_declined
webhook.
- If and when Klarna closes the transaction because they did not receive the funds from the customer's bank, we move the payment to
On average, it takes one to three business days to receive an answer from the bank, but it can take up to 10 business days to receive the final answer. If the customer funds reach Klarna after the 10 business days window, Klarna returns the money to the customer without notifying us.
Use the payment_id
from the payment response to retrieve details about the payment.
get
https://api.checkout.com/payments/{id}
1{2"id": "pay_mnnf6wnp7fdupa2jechtgg5cr4",3"requested_on": "2024-08-13T15:14:28.1308176Z",4"source": {5"type": "klarna",6"account_holder": {7"first_name": "Eve",8"last_name": "Test",9"billing_address": {10"address_line1": "Bodestr. 1-3",11"city": "Berlin",12"zip": "10178",13"country": "DE",14"state": ""15},16"email": "[email protected]",17"date_of_birth": "1992-01-01",18"phone": {19"number": "+4915257607960"20},21"identification": {}22}23},24"payment_type": "Installment",25"payment_plan": {26"financing": true27},28"items": [29{30"name": "OTR-AC Elite 90 Capsules",31"quantity": 1,32"unit_price": 4998,33"total_amount": 4998,34"tax_amount": 0,35"discount_amount": 036},37{38"name": "Discount",39"quantity": 1,40"unit_price": 1000,41"total_amount": 1000,42"discount_amount": 043}44],45"amount": 3998,46"currency": "EUR",47"status": "Captured",48"approved": true,49"balances": {50"total_authorized": 3998,51"total_voided": 0,52"available_to_void": 0,53"total_captured": 3998,54"available_to_capture": 0,55"total_refunded": 0,56"available_to_refund": 399857},58"shipping": {59"first_name": "Samuel",60"last_name": "Rudd",61"email": "[email protected]",62"address": {63"address_line1": "Rotherstraße 19",64"city": "Berlin",65"state": "",66"zip": "10245",67"country": "DE"68},69"phone": {70"number": "+4930774615846"71}72},73"processing": {74"partner_session_id": "43c4421b-605a-47c2-88bb-d5dd9025222b",75"partner_order_id": "dc3b8712-123a-45ef-bc3d-b356a158b31b",76"fraud_status": "ACCEPTED",77"locale": "en-GB",78"tax_amount": 0,79"shipping_amount": 080},81"_links": {82"self": {83"href": "https://api.sandbox.checkout.com/payments/pay_mnnf6wnp7fdupa2jechtgg5cr4"84},85"actions": {86"href": "https://api.sandbox.checkout.com/payments/pay_mnnf6wnp7fdupa2jechtgg5cr4/actions"87},88"refund": {89"href": "https://api.sandbox.checkout.com/payments/pay_mnnf6wnp7fdupa2jechtgg5cr4/refunds"90}91}92}
Klarna Debit Risk supports both partial and full refunds.
You can refund the payment in the Dashboard.
Alternatively, call the Refund a payment endpoint, and provide the payment_id
value from the Request a payment response as the {id}
path parameter.
To provide a better customer experience when you perform a partial refund, submit the refunded items' information using the items[]
object in the refund request.
post
https://api.checkout.com/payments/{id}/refunds
1{2"items": [3{4"quantity": 1,5"name": "laptop",6"unit_price": 2000,7"reference": "12368f7000111",8"type": "physical"9}10]11}
For more information, see Refund a payment.
Learn how to manage webhooks using our API, or the Dashboard.
When integrating Klarna Debit Risk, you can configure the following webhooks:
Webhook | Description |
---|---|
| Occurs when the payment request is successfully initiated. |
| Occurs when the payment is approved by the partner. |
| Occurs when the payment is successfully captured. |
| Occurs when the capture request is rejected. |
| Occurs when the capture request is successfully sent to the partner. |
| Occurs when the payment is fully or partially refunded. |
| Occurs when the refund fails. |
To test your Klarna integration:
- Contact your Account Manager or [email protected] to activate Klarna payments in your Checkout.com test environment.
- Create a Klarna transaction by following the Klarna Payment flow and using Klarna's test environment data.
- Using the Klarna JS SDK, embed the JWT token to render the UI components, and carry out the payment via the pop-up window.
- Complete the payment.
If successful, you will then be redirected to your predefined success URL.
Contact your Account Manager or [email protected] to move your integration to a live environment.
Optional features include:
- Extra merchant data
- Discounts
Depending on the merchant segment or the services available to consumers, Klarna may require additional information regarding the customer, the merchant, and/or the purchase. This information is known as extra merchant data (EMD) and is data that is typically not available at checkout. Klarna uses this information to complete an assertive risk assessment, enable new promotional products, and improve conversion rates for a boost in performance.
If you enable consumers to register to your site, EMD enables Klarna to identify your returning consumers and enhance the services offered even if they have no previous history paying with Klarna. This can also help Klarna to offer enhanced services and personalize the customer experience.
To use EMD for registered checkout and Klarna deals, send the following objects as a serialized JSON object when authorizing the session using Klarna JS SDK:
customer_account_info
payment_history_full
payment_history_simple
If you operate within the travel or ticketing segments, you must provide Klarna with the required EMD data points:
If you are selling services associated to the travel segment, you must provide information about the passengers and the itinerary to be booked via the applicable EMD for the service provided:
air_reservation_details
train_reservation_details
bus_reservation_details
ferry_reservation_details
car_rental_reservation_details
hotel_reservation_details
trip_reservation_details
For more information about the EMD objects, see the Klarna's extra merchant data documentation
You can provide tax information from the payment you are processing.
You can provide tax information for each item using the following fields:
items[].tax_rate
items[].tax_amount
You can provide either one of these fields and then Checkout.com calculates the other:
tax_amount
= (tax_rate
*total_amount
) / (100 +tax_rate
)tax_rate
= (100 *tax amount
) / (total_amount
-tax amount
)
1{2"currency": "EUR",3"amount": 1000,4"source": {5"type": "klarna",6"account_holder": {7"billing_address": {8"country": "DE"9}10}11},12"amount": 1000,13"items": [14{15"type": "Physical",16"name": "jumper",17"quantity": 1,18"reference": "98-765-XYZ",19"total_amount": 20000,20"unit_price": 100,21"tax_rate": 2000,22"tax_amount": 9917,23"total_amount": 5950024}25],26"processing_channel_id": "pc_rikhvutraenu7eno62f5u2buge",27"processing": {28"locale": "en-GB"29}30}
You can apply a discount to an individual item or to all items in the transaction:
- For an individual item, provide the discount amount in the item's
items[].discount_amount
field. - For all items, provide:
- A new item object with type
discount
("items[].type:"discount"
) - The discount amount in
"items[].total_amount"
- A new item object with type
You can apply both discounts to the same transaction.
The following example shows two individual items with individual discounts applied, and an additional discount to the entire transaction:
1 x jumper 50 EUR discounted 15%, tax 25%
items[0].quantity
: 1items[0].unit_price
: 5000items[0].discount_amount
: 15% of 5000 = 750items[0].total_amount
: (5000 * 1) - 750 = 4250- (
unit_price
x quantity) -discount_amount
- (
items[0].tax_rate
: 2500items[0].tax_amount
: (25 * 4250) / (100 + 25) = 850- (tax rate *
total_amount
) / (100 + tax rate)
- (tax rate *
3 x white t-shirt 15 EUR discounted 10%, tax 25%
item.[1].quantity
: 3item.[1].unit_price
: 1500items[1].discount_amount
: 15% of 1500 = 450items[1].total_amount
: (1500 * 3) - 450 = 4050- (
unit_price
x quantity) -discount_amount
- (
items[1].tax_rate
: 2500items[1].tax_amount
: (25 * 4050) / (100 + 25) = 810- (tax rate *
total_amount
) / (100 + tax rate)
- (tax rate *
10% discount on an 83 EUR order
- 1 x order = 8300
items[2].type
: discountitems[2].total_amount
: (4250 + 4050) * 0.1 = 830- (
items[0].total_amount
+items[1].total_amount
) x discount rate
- (
1{2"currency": "EUR",3"source": {4"type": "klarna",5"account_holder": {6"billing_address": {7"country": "DE"8}9}10},11"amount": 7470,12"items": [13{14"type": "Physical",15"name": "jumper",16"quantity": 1,17"reference": "98-765-XYZ",18"total_amount": 4250,19"discount_amount": 750,20"tax_amount": 850,21"tax_rate": 2500,22"unit_price": 500023},24{25"type": "Physical",26"name": "white t-shirt ",27"quantity": 3,28"reference": "12-345-ABC",29"total_amount": 4050,30"discount_amount": 450,31"tax_amount": 810,32"tax_rate": 2500,33"unit_price": 150034},35{36"type": "discount",37"name": "10% discount",38"quantity": 1,39"reference": "PROMO10",40"total_amount": 830,41"unit_price": 83042}43],44"processing_channel_id": "pc_rikhvutraenu7eno62f5u2buge",45"processing": {46"locale": "en-DE",47"shipping_amount": "0",48"tax_amount": "1660"49}50}