Klarna

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:

FieldRequirement
order.basketAt least one item. Each item needs name, sku, price, qty and vat_rate.
order.billing_address.countryThe 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:

FieldDescription
nameThe name the customer sees.
skuYour reference for the item.
priceThe price of one item, including VAT, in the currency's smallest unit.
qtyThe number of items.
vat_rateThe 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 amount

Klarna checks that the order lines add up to the payment's amount. Make sure that the sum of
price × qty for every item, plus the shipping price, equals amount.

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.