Enable Klarna payment messaging on your online store with Klarna's Mobile SDK and boost transparency and conversion. This includes our pre-qualification feature, which allows customers to check their eligibility for Klarna financing before completing a payment request. This reduces friction and increases confidence, as customers know their options upfront.
![]() | ![]() | ![]() |
| Messaging on the homepage | Messaging on the product detail page | Messaging in the checkout |
Link copied!
Before you integrate On-site messaging, please check that you meet the following conditions:
Link copied!
Adding On-Site Messaging to your native app is a straightforward process. At a high level, to achieve this tailored experience for your users, you will need to follow these steps:
Link copied!
First, add the Klarna Mobile SDK Maven repository:
Copied
repositories {
maven("https://x.klarnacdn.net/mobile-sdk/")
}
Next, add the Klarna Mobile SDK Messaging Library as a dependency to your application:
Copied
dependencies {
implementation("com.klarna.mobile:klarna-network-messaging:2.x.x")
}
Link copied!
The first step to add On-Site Messaging to your application is to initialize the Klarna SDK and provide the required configuration:
Copied
import com.klarna.mobile.sdk.klarna.network.core.api.klarna.KlarnaConfiguration
import com.klarna.mobile.sdk.klarna.network.core.api.klarna.Klarna
// Create an instance of KlarnaConfiguration
val configuration = KlarnaConfiguration(
clientId = clientId,
accountId = accountId,
locale = locale,
sdkToken = sdkToken,
)
// Initialize KlarnaLink copied!
| Param | Type | Description |
|---|---|---|
| clientId | String | The client ID of the partner account that is integrating the Mobile SDK. If the integration is done by a PSP/DP then this must be set to the distribution partners own client ID. |
| accountId | String | (Optional) When transacting on-behalf of another account then the partner account ID is specified using the accountId property. |
| locale | String | (Optional) Set the default locale(ISO 3166-1 alpha-2) for the SDK. System default locale will be used if not set. |
| sdkToken | String | (Optional) The SDK Token allows the SDK to be initialized with an existing session. Token is only retrievable from the server side via Shopping Session API. |
Link copied!
The On-Site Messaging native view on Android is the KlarnaMessagingPlacementView. You can create this view programmatically and add it to your layout with your desired layout options.
Copied
import com.klarna.mobile.sdk.api.KlarnaTheme
import com.klarna.mobile.sdk.klarna.network.core.api.klarna.Klarna
import com.klarna.mobile.sdk.klarna.network.messaging.api.KlarnaMessagingPlacementConfiguration
import com.klarna.mobile.sdk.klarna.network.messaging.api.KlarnaMessagingPlacementView
// Create an instance of KlarnaMessagingPlacementConfiguration
// Depending on your requirements, you can create `CreditPromotionBadge` or
// `CreditPromotionAutoSize` configuration
val placementConfiguration = KlarnaMessagingPlacementConfiguration.CreditPromotionBadge(
theme = KlarnaTheme.AUTOMATIC,
amount = 10000L,
currency = "USD"
)Link copied!
| Param | Type | Description - theme KlarnaTheme (Optional) Enumerated theme value to specify how to stylize the view on light, dark or automatic (system) configurations. Default value isLIGHT |
|---|---|---|
| amount | Long | Amount for the placement. Set in micro units ($120.00 = 12000), used for amount based credit promotions. |
| currency | String | 3-letter ISO 4217 currency code |
| Param | Type | Description - theme KlarnaTheme (Optional) Enumerated theme value to specify how to stylize the view on light, dark or automatic (system) configurations. |
|---|---|---|
| amount | Long | Amount for the placement. Set in micro units ($120.00 = 12000), used for amount based credit promotions. |
| currency | String | 3-letter ISO 4217 currency code |
| Name | Descriptions |
|---|---|
| LIGHT | Light style for placement view. |
| DARK | Dark style for placement view. |
| AUTOMATIC | Automatic theme that will use the system’s user interface style. |