Klarna Docs - How to install the Shopify On-site messaging app
How to install the Shopify On-site messaging app

Read this guide to learn how to add the Klarna On-site messaging Shopify app to your Shopify store.

Before you begin, you must integrate Klarna Payments or enable Klarna for Shopify Payments. The On-Site Messaging app will rely on your integration to connect to your store.

We highly recommend that you are using Online Store 2.0 and that you have upgraded to Checkout Extensibility for the best experience using this app. This installation guide is applicable for stores compatible with the Klarna OSM Shopify app. If your store isn’t compatible with the app, you can install Klarna On-site messaging manually using JavaScript. For more details, refer to the manual OSM installation guide.

  • Install the Klarna On-site messaging app from the Shopify App Store.
  • Click Install App .
  • Grant permissions and confirm installation.

After installing the app, Klarna will try to connect your account automatically. If we detect your myshopify.com domain in our system, we'll link your store for you.

If not, follow these steps to connect manually:

  • In your Shopify Admin, go to: 
Apps > Klarna On-site Messaging > Settings
  • Enter your Klarna Merchant ID (MID)
  • Click Connect
The screenshot of Shopify store admin after a merchant links a Shopify store to their Klarna MID.

A Klarna merchant account linked to a Shopify store.

You can find your Klarna MID in the Klarna Merchant Portal and it starts with a K, N or A and is followed by 6-7 digits. If you are not integrating Klarna Payments directly through Klarna please reach out to your payment partner for this. If you are getting a 404 error, please follow the steps outlined here to troubleshoot.

The final step is to add placements. There are two way of doing this depending on your theme:

The extended access setting enhances your Klarna integration allow us to gather additional information about orders placed with Klarna in your store and display it to the customer. These extended access features are enabled by default when you install the On-Site messaging app, but can be disabled by deselecting the Extended Access option in the app settings.

We access minimal data as needed for the following additional features:

  • Updating Klarna’s merchant_reference_1 field with the corresponding Shopify order name. This allows us to display the correct order ID to your customers in the Klarna app. This also makes it easier for you and Klarna support teams to find orders quickly and easily in our systems if needed. (October 11, 2022)
  • The Klarna order ID is added as a Shopify order note on the Shopify backend. This is also helpful information you can provide to Klarna merchant support if needed. (November 3, 2022)
  • A Klarna tag is added to Shopify orders placed through Klarna. (September 20, 2023)
  • Product URL and image URL are added to the Klarna order shortly after the order is placed. This allows your customers to see their order details in the Klarna app and emails from Klarna.

You can manage the Extended Access setting in Apps > Klarna On-site Messaging > Settings.

When Extended Access is enabled in a Shopify store, additional order details are visible in the Merchant portal, for example, the Shopify order ID as Reference and an image of the product.

A screenshot showing Extended Access in Shopify admin.

Extend Access is an optional configuration that provides additional permissions to enhance the Klarna On-site messaging app’s functionalities.

If you no longer want to use the Klarna On-site messaging (OSM) Shopify app in your store, do the following to remove all inserted code for your store:

  1. Disconnect the account from the Klarna OSM Shopify app in Shopify admin > Settings > Apps.
  2. Delete the app from Shopify admin > Apps as shown on the screenshot below.
A screenshot of the Shopify admin showing the Delete function for Klarna On-site messaging Shopify app.

Uninstalling the Klarna On-site messaging app from a Shopify store.

Deleting the Klarna OSM Shopify app removes all code from your store. You can confirm the code is deleted by viewing the HTML source and searching for the following code elements:

  • To check that the JavaScript libraries loaded in your store have been deleted, search for the asyncLoad function in the source code.
  • To check that the placement code has been deleted, search for the klarna-placement HTML element in the source code.

If you already removed the Klarna On-site messaging Shopify app, but the KlarnaThemeGlobals code was not removed from your theme (if added to your theme prior to 2022-Dec-13), you can manually remove it from the theme.liquid file in your Shopify admin > Sales channels > Online Store > Themes > > Edit code.