Worldline
Integration via Messaging API

Integrate Messaging API to display branded payment options when SDK use isn’t feasible, ensuring a consistent and compliant checkout experience.

Integrate Klarna On-site Messaging using the Messaging API when Klarna SDK cannot be used due to infrastructure limitations. This integration allows you to display Klarna-branded promotional messages dynamically on your website, including product pages, cart pages, and banners.

When the Klarna SDK cannot be implemented, the Messaging API provides an alternative way to retrieve localized content such as text, icons, and links that adapt to transaction amounts and customer context. This ensures that customers are informed about Klarna’s flexible payment options before reaching checkout.

Prerequisites recap

Before you integrate On-site messaging, check that you meet the following prerequisites:

  1. Ensure that you have Klarna enabled with your Acquiring Partner.
  2. Confirm you have access to the Klarna Portal.
  3. Inside Klarna Portal:
    1. Confirm that you have generated an API key.
  4. You have your Partner account ID
  5. Messaging API access is enabled for your account.
  6. You can render HTML, parse JSON, and manage client-side state.

Integration overview

Here's an overview of all the steps to add On-site messaging using Messaging API into your website:

Integration details

Step 1: Retrieve OSM messaging

All placement APIs share a common base path. Use the following pattern and specify the appropriate placement key: {path}/messaging/{placement_key}

Placements Keys:

  • credit-promotion-auto-size
  • credit-promotion-badge
  • top-strip-promotion-auto-size
  • top-strip-promotion-badge

Credit Promotion Placements

Placement typesCharacteristics

credit-promotion-auto-size

Displays interactive Klarna messaging. Your customers can click on it and expand the information on the payment methods with calculated prices. Mentions Klarna inline as part of the text.

credit-promotion-badge

Displays interactive Klarna messaging. Your customers can click on it and expand the information on the payment methods with calculated prices. Displays Klarna's logo in svg,
Auto-size placement
Credit PromotionKlarna Icon
GET:/v2/accounts/{partner_account_id}/payment/messaging/credit-promotion-auto-size
Show recommended
ParameterRequiredDescription
partner_account_id
Yes

Unique account identifier assigned by Klarna to the onboarded merchant

Here you can find all required parameters for this operation getCreditPromotionMessagingForAutoSizeKlarna Icon
Badge placement
Credit PromotionKlarna Icon
GET:/v2/accounts/{partner_account_id}/payment/messaging/credit-promotion-badge
Show recommended
ParameterRequiredDescription
partner_account_id
Yes

Unique account identifier assigned by Klarna to the onboarded merchant

Here you can find all required parameters for this operation getCreditPromotionMessagingForBadgeKlarna Icon

Top strip Placements

Top strip placements are non-amount based and similar to credit promotion placements we can use the same API to retrieve top-strip-promotion-auto-size and top-strip-promotion-badge

Each placement has an unique key that should be used in order to specify the placement to be displayed.

Placement typesOptions

top-strip-promotion-auto-size

Recommended as static asset at the top of the pages of your online store. Displays interactive Klarna messaging. Your customers can click on it and expand the information on the payment methods. Mentions Klarna inline as part of the text.

top-strip-promotion-badge

Recommended as static at the top of the pages of your online store. Displays interactive Klarna messaging. Your customers can click on it and expand the information on the payment methods.
Auto-size placements
Top StripKlarna Icon
GET:/v2/accounts/{partner_account_id}/payment/messaging/top-strip-promotion-auto-size
Show recommended
ParameterRequiredDescription
partner_account_id
Yes

Unique account identifier assigned by Klarna to the onboarded merchant

Here you can find all required parameters for this operation getTopStripPromotionMessagingForAutoSizeKlarna Icon
Badge placements
Top StripKlarna Icon
GET:/v2/accounts/{partner_account_id}/payment/messaging/top-strip-promotion-badge
Show recommended
ParameterRequiredDescription
partner_account_id
Yes

Unique account identifier assigned by Klarna to the onboarded merchant

Here you can find all required parameters for this operation getTopStripPromotionMessagingForBadgeKlarna Icon

The message.parts[].context field determines how links such as Learn more or Check purchase power should behave.

  • INFO: Informational content. Can open within the same tab, iframe, or WebView.
  • AUTH: Requi Requires customer authentication. Must open in a new browser tab or window. For native implementations: