The order details a payment needs before Klarna can be offered.
Klarna needs to know what the customer is buying. Send the order details when you create the
payment, or Klarna is not offered in the payment window.
Requirements
A payment can be paid with Klarna when it has:
| Field | Requirement |
|---|---|
order.basket | At least one item. Each item needs name, sku, price, qty and vat_rate. |
order.billing_address.country | The customer's country as a two-letter code, for example DK. |
If one of these is missing, the payment window shows the payment's other methods, but not
Klarna.
The basket
Each basket item becomes an order line at Klarna:
| Field | Description |
|---|---|
name | The name the customer sees. |
sku | Your reference for the item. |
price | The price of one item, including VAT, in the currency's smallest unit. |
qty | The number of items. |
vat_rate | The VAT rate as a decimal, for example 0.25 for 25%. |
If you set order.shipping.price, the shipping is added as its own order line.
The basket must add up to the amountKlarna checks that the order lines add up to the payment's
amount. Make sure that the sum of
price × qtyfor every item, plus the shipping price, equalsamount.
Example
{
"amount": 23500,
"currency": "DKK",
"order_id": "1234",
"methods": ["klarna"],
"order": {
"basket": [
{
"name": "T-shirt",
"sku": "tshirt-blue-m",
"price": 11250,
"qty": 2,
"vat_rate": 0.25
}
],
"shipping": {
"method": "own_delivery",
"price": 1000,
"vat_rate": 0.25
},
"billing_address": {
"name": "Jane Doe",
"email": "[email protected]",
"country": "DK"
}
}
}The basket adds up to 2 × 11250 + 1000 = 23500, which matches amount.