Payment-method icon

Klarna for API only

Add Klarna to an existing API-only integration.

Starting January 31st, 2024, the /payments/details API call is no longer required for Klarna transactions. However, you can continue using this step to check the final payment status. To ensure you are informed of the final payment status for all transactions, you also need to use webhooks to update your order management system.

Accept Klarna payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

With our API-only integration, you can accept Klarna payments using either:

  • The Klarna widget: the shopper completes the payment in your checkout.
    For more information about the Klarna widget, see the Klarna documentation.
  • Redirect to Klarna: the shopper is redirected to Klarna to complete the payment.

When making a Klarna payment:

  1. Provide information about the purchased items by specifying lineItems in your payment request.
  2. Indicate in your payment request if you want to use the Klarna widget or redirect to Klarna.
  3. Capture the payment after the goods have been sent. This triggers the payment instructions to be sent to the shopper.

Requirements

Requirement Description
Integration type Make sure that you have an existing API-only integration.
Setup steps Before you begin, add Klarna in your test Customer Area.

Build your payment form for Klarna

When making a Klarna payment, collect the following shopper details:

Shopper detail Description Required
Shopper name The shopper's full name and gender, if specified.
Shopper email The shopper's email address. This is where Klarna will send the invoice.
The billing address The postal address to be included on the invoice.

For improved conversion rates, we strongly recommend that you collect the shopper name and the billing address.

If you are using the /paymentMethods endpoint to show the available payment methods to the shopper, specify in your request one of the following combinations of countryCode and amount.currency, depending on which Klarna payment method you want to accept:

Country/region countryCode amount.currency Pay now Pay later Pay over time
Australia AU AUD -x- -x- -white_check_mark-
Austria AT EUR -white_check_mark- -white_check_mark- -white_check_mark-
Belgium BE EUR -white_check_mark- -white_check_mark- -x-
Canada CA CAD -x- -x- -white_check_mark-
Czech Republic CZ CZK -x- -x- -white_check_mark-
Denmark DK DKK -x- -white_check_mark- -x-
Finland FI EUR -x- -white_check_mark- -white_check_mark-
France FR EUR -x- -x- -white_check_mark-
Germany DE EUR -white_check_mark- -white_check_mark- -white_check_mark-
Greece GR EUR -x- -x- -white_check_mark-
Ireland IE EUR -x- -x- -white_check_mark-
Italy IT EUR -x- -x- -white_check_mark-
Norway NO NOK -x- -white_check_mark- -white_check_mark-
Poland PL PLN -x- -white_check_mark- -x-
Portugal PT EUR -x- -x- -white_check_mark-
Romania RO RON -x- -x- -white_check_mark-
Spain ES EUR -x- -x- -white_check_mark-
Sweden SE SEK -white_check_mark- -white_check_mark- -white_check_mark-
Switzerland CH CHF -white_check_mark-
See note 3
-white_check_mark-
See note 3
-x-
The Netherlands NL EUR -white_check_mark- -white_check_mark- -white_check_mark-
United Kingdom GB GBP -x- -white_check_mark- -white_check_mark-
United States US USD -x- -x- -white_check_mark-

3If you want to offer Klarna in Switzerland, contact our Support Team.

The /paymentMethods response contains:

  • paymentMethod.type: klarna_paynow for Klarna Pay Now.
  • paymentMethod.type: klarna for Klarna buy now pay later.
  • paymentMethod.type: klarna_account for Klarna Pay Over Time.

We provide logos for Klarna that you can use on your payment form. For more information, refer to Downloading logos.

Make a payment

Klarna requires shopper details such as name and address to approve a payment. To improve shopper experience and conversion rates, provide these details in the payment request and make sure that the parameters in the request match.

Send the shopper name and billing address in the request.
We recommend that you send the shopper name and billing address to improve the shopper experience. If not provided in the request, Klarna will ask the shopper to provide these parameters in the checkout page.

Make sure that the country, the currency, and the shopper locale in the request are compatible.

  • Klarna will only approve the payment if the country it is made from matches the currency and the country specified in the billing address.
  • The Klarna checkout page can only be rendered in another language if the specified locale matches the country and currency used in the request. By default, the checkout page is rendered is English (en-US).

The following table shows the possible combinations that you can send in a payment request:

Country countryCode
billingAddress.country
amount.currency shopperLocale
default
shopperLocale
alternative
Australia AU AUD en_US en_GB
Austria AT EUR en_US de_AT
Belgium BE EUR en_US nl_BE, fr_BE
Canada CA CAD en_US fr_FR
Czechia CZ CZK en_US cs_CZ
Denmark DK DKK en_US da_DK
Finland FI EUR en_US fi_FI, sv_FI
France FR EUR en_US fr_FR, en_FR
Germany DE EUR en_US de_DE
Greece GR EUR en_US el_GR
Ireland IE EUR en_US en_GB
Italy IT EUR en_US it_IT
Norway NO NOK en_US nb_NO
Poland PL PLN en_US pl_PL
Portugal PT EUR en_US pt_PT
Romania RO RON en_US ro_RO
Spain ES EUR en_US es_ES
Sweden SE SEK en_US sv_SE
Switzerland CH CHF en_US de_CH, fr_CH, it_CH
The Netherlands NL EUR en_US nl_NL
United Kingdom GB GBP en_US en_GB
United States US USD en_US es_US

Make a payment request

From your server, make a /payments request, specifying:

  • paymentMethod.type: The type of Klarna payment the shopper wants to use. Possible values:
    • klarna_paynow for Klarna Pay Now.
    • klarna for Klarna buy now pay later.
    • klarna_account for Klarna Pay Over Time.
  • How you want the shopper to complete the payment:

    • On your own checkout using the Klarna widget: add paymentMethod.subtype with a value of sdk. For example:

      {
      ...
      "paymentMethod": {
        "type":"klarna",
        "subtype":"sdk"
      },
      ...
      }
    • Using a redirect to Klarna: do not add the paymentMethod.subtype parameter.

Parameter name Required Description
lineItems -white_check_mark- Price and product information about the purchased items.
Klarna only approves the payment if the total amount specified in lineItems matches the amount.value, and each line item contains a description.
You can optionally specify productUrl and imageUrl to include a link to and a picture of the purchased items in the invoice.
shopperEmail -white_check_mark-
See note 1
The shopper's email address. This is where Klarna will send the payment instructions.
For requirements on this field, see Klarna's documentation.
shopperReference -white_check_mark- A unique reference to identify the shopper (minimum length three characters).
shopperName The shopper's full name.
Recommended to increase conversion rates. If you do not include it, Klarna will ask the shopper to provide this in the checkout page.
For requirements on this field, see Klarna's documentation.
billingAddress The postal address of the shopper.
Recommended to increase conversion rates. If you do not include it, Klarna will ask the shopper to provide this in the checkout page.
For requirements on this field, see Klarna's documentation.
deliveryAddress The postal address where the purchased goods should be delivered. If not provided, this is the same as the billing address.
For requirements on this field, see Klarna's documentation.

If the recipient name is different from the shopper making the payment, specify deliveryAddress.firstName and deliveryAddress.lastName to share the recipient name with Klarna.
shopperLocale A combination of language code and country code to define the language of the Klarna checkout page. By default, the checkout page is rendered is English.

This has to match the countryCode and currency used in the request. For more information, see Klarna's documentation.
countryCode -white_check_mark- The shopper's country.

This has to match the country of the billingAddress.
telephoneNumber The shopper's telephone number, if provided.
For requirements on this field, see Klarna's documentation.
additionalData.
openinvoicedata.merchantData
For some products or business models, Klarna can require additional information. If you need to send in this information, specify here the Base64 encoded JSON of the attachment.body value described in Klarna's documentation.

1You need to include shopperEmail to defend against potential disputes from shoppers.

A sample /payments request for Klarna — Pay later using a redirect: