HomeDocumentationAPI Reference
Documentation

Klarna

About Klarna

Klarna Logo

Klarna is the largest provider of Pay later services in the world. Klarna offers flexible payment options that give customers more freedom to choose when and how to pay for a purchase. Klarna provides payment solutions for 90 million consumers and over 250+ thousand retailers across 19 core markets.

Payment Flow

Klarna payment flow

Properties

Type of Payment
Online
Chargebacks
Yes
Consumer Currency
AUD, CHF, DKK, EUR, GBP, NOK, SEK, USD
Consumer Country
Austria, Australia, Belgium, Denmark, Finland, France, Germany, Italy, Netherlands, Norway, Spain, Sweden, Switzerland, United Kingdom, United States
Expiry Period
URL Expiry is usually 48 hours after its creation. A consumer will be able to pay on the hosted payment page until 1 hour before the Payment Session expiration.

Once the order is created the merchant has 7 days to capture it.
Recurring Payments
No
Partial Payment
Yes
Capture of an amount less the then original authorization is supported, however only a single partial payment is supported at this time.
Refunds
Yes

Sample Checkout

POST https://checkout.rch.io/v2.21

{
  "MerchantId": "ee54106f-30b8-45df-b62f-b649fc80eafd",
  "ReferenceId": "1621468436723",
  "ConsumerCurrency": "USD",
  "PaymentMethod": "KLARNA",
  "Capture": false,
  "Items": [
    {
      "Description": "Thingy",
      "ConsumerPrice": 100,
      "Quantity": 1,
      "Sku": "4383471583721"
      "ImageUrl": "test.jpg"
    }
  ],
  "Consumer": {
    "Name": "Big Red",
    "Email": "[email protected]",
    "Phone": "3337678899",
    "Address": "223 elm tree",
    "City": "place",
    "Region": "Hamburg",
    "PostalCode": "20",
    "Country": "US"
  },
  "DeviceFingerprint": "c41487d2-6654-4d6a-8e55-2f3d92b285f8",
  "StashId": null,
  "Return": "https://checkout.rch.red/return.php"
}
{
  "OrderId": "c29173aa-dffb-400e-8a03-0a6636e77719",
  "UnderReview": false,
  "Expiry": "2021-05-21T23:54:02Z",
  "Authorized": false,
  "Completed": false,
  "Captured": false,
  "Action": {
    "Redirect": "https://sandbox.withreach.com/auth/9a2c1f80-01b5-4cb4-90ae-c8adcb85cb0a"
  }
}

Technical Considerations

In some regions, such as the US and UK, Klarna may choose to perform additional fraud screening on your order requests. If a payment is flagged for review, the transaction state will be held in CommitAccepted until we have received final authorization from Klarna.

When you attempt to capture an order in this state, the capture response will return with Completed=false. You should then wait for the notification informing you that the order has transitioned to Processed or Processing Failed.

See: States and Events and POST /capture

Related Information

  • Klarna maintains a Customer Service portal for all supported countries here.
API icon

Please see our most recent API Reference guide.

Klarna Guide

Klarna is a payment method that allows customers to pay for purchases using both immediate and deferred payments. Klarna includes various payment options, based on the customer’s region,s including:

  • pay now - supports direct debit, major credit cards, and Sofort
  • pay later - pay in 14, 21, or 30 days
  • pay over time (pay in) - pay in 3 or 4 equal instalments

The merchant's benefit is that full payment is received at the time of purchase, and Klarna collects the payments from the customer.

Implementation

Implementing Klarna through Reach is as simple as integrating it with our other payment products. Once configured through our merchant support, when the customer checkout is rendered in a region where Klarna is available, the Klarna payment method will be visible for customer selection. When the customer selects Klarna, they will be redirected to Klarna’s hosted checkout page. When the customer completes their purchase, they are redirected to the merchant site.

Custom Branding Options

If you want to enhance your customers' Klarna-hosted payment experience further, you can supply a feature image or logo matching your branding.

Contact the [merchant support team](mailto: [email protected]?subject=Klarna Custom Branding Request) for assistance.

Default and customized checkout comparison

ℹ️

Note

Your feature image may appear slightly darker at Klarna checkout.

On-Site Messaging

On-Site Messaging is a platform offered by Klarna which provides the ability to include tailored messaging in the merchant’s web site. Using on-site messaging, you can better inform your customers of the options available through the Klarna payment method (e.g., Pay in instalments).

Implementation

To enable this capability, you must include the Klarna JavaScript library on your page according to Klarna’s documentation and set the src and data-client-id parameters with the appropriate values as returned from a call to Reach's /getPaymentMethods endpoint.

ℹ️

Note

Klarna provides different JavaScript libraries and client IDs for different regions. Be sure to include the correct country code, currency, or locale when making the call to getPaymentMethods to retrieve the URL and client ID.

Use the response values and dynamically set them on your page.

Mapping
PaymentMethod] { "code.Parameters.ClientId -> data-client-id PaymentMethod { "codes.Parameters.OnSiteJavaScriptUrl -> src

Integration of Klarna’s on-site messaging generally follows the guide provided on Klarna’s website, with minor changes to allow integration within the Reach ecosystem.

Klarna suggests including the script tag in the first element of the page’s body. However, it is possible to include the script dynamically after retrieving the URL and client ID from the getPaymentMethods call.

{
      "Id": "KLARNA",
      "Name": "Klarna",
      "Class": "Online",
      "Language": "en",
      "Local": true,
      "Parameters": {
        "ClientId": "11111111-2222-3333-4444-555555555555",
        "OnSiteJavaScriptUrl": "https://eu-library.klarnaservices.com/lib.js"
      }
    }
let script = document.createElement('script');
 // the url provided by getPaymentMethods
script.src = <source>;
// the client ID provided by getPaymentMethods
script.setAttribute('data-client-id’, <client ID>);
script.async = true;
// ID so we can replace the script for region changes
script.id = 'klarna';
document.body.appendChild(script);
// refresh the adds after attaching the script
window.KlarnaOnsiteService = window.KlarnaOnsiteService || []
window.KlarnaOnsiteService.push({ eventName: 'refresh-placements' })
<script
    src="https://eu-library.klarnaservices.com/lib.js"
    async
    data-client-id="11111111-2222-3333-4444-555555555555"
></script>

Including On-Site Messages

The on-site messages themselves are included in the page using Klarna placement tags. Klarna provides information about using placement tags on their site.

ℹ️

Note

If you are using amount based placements, the data-purchase-amount should be provided as a whole number. For example, $29.99 should be set as 2999 with the decimal place excluded.

⚠️

Important

If invalid information is provided to the tags, or Klarna is not available for the customers region, the tags will not be displayed.

Klarna OSM Integration Requirements

⚠️

Important

It is a requirement that merchants add a Klarna FAQ link in the site footer utilizing the FAQ OSM script. The associated placement data-key is ‘info-page’ and merchants should pass the appropriate locale based on the region of your customer.

The following code should be added on the page where you want the content to be displayed:

<!-- Placement v2 -->
<klarna-placement
  data-key="info-page"
  data-locale="en-SE"
></klarna-placement>
<!-- end Placement -->

This will dynamically include the appropriate Klarna FAQ and explain the payment options available in the customer's particular region.