API Ecosystem

Integrate with Klarna’s Global API Ecosystem by using dedicated test and live environments, global endpoints, and best practices to ensure secure, scalable, and reliable performance.

Klarna provides both test and live environments, each designed to support seamless global integration of the Partner management API, Partner product API, and other Klarna products, irrespective of your location, the customer’s origin or other particular considerations.

Klarna Partners are required to make both test and live environments available to all Partners integrated via their services to allow for the validation of their Klarna integration. All payment services available in production are required to be included in this availability. Klarna requires that accounts in any environment not be shared across multiple Partners.

These environments function entirely independently of each other, and may behave differently as a result of the below considerations:

  • Access and authentication: different base URLs and credentials are used to access the live and test environments.
  • Functionality: the test environment simulates the live environment but lacks active fraud assessments, including any identity or address detail validation. Any atypical flow needs manual initiation through test triggers.
  • Data security: the test environment does not use One-time passwords (OTP), making it inappropriate for sharing Personal Identifiable Information (PII). PII entered into the test environment is replaced with synthetic data, which means response values might vary unless Klarna’s sample data is used. This approach minimizes data leak risks.
  • Settings: Adjustments made in one environment do not affect the other. For instance, changes to branding or product offering made in the test environment won’t impact the live environment.
  • Transactions and accounts: transactions or accounts created in one environment do not transfer to the other. For example, transactions placed in the test environment will not appear in the live environment.

Global base URLs are provided to optimize latency and enhance fault tolerance.

EnvironmentDNSIP Addresses
Liveapi-global.klarna.com13.248.252.240, 76.223.28.105
Testapi-global.test.klarna.com3.33.145.71, 13.248.213.183

Callbacks from Klarna will originate from specific IP addresses for each environment.

EnvironmentCallback IP Addresses
Live52.17.117.56, 52.17.176.198, 52.0.45.33, 52.0.46.187, 13.211.30.100, 3.104.49.49, 13.54.229.130
Test34.242.203.160, 34.242.19.4, 52.45.47.152, 34.235.91.238, 3.24.91.202, 52.62.115.68, 52.63.129.92

Klarna.js is a Web SDK that bundles all our products, including payments and Boost products. This SDK will allow you to handle your most frequent use cases easily, with a few lines of code, and allowing customization for additional edge cases.

Our API is primarily redirect driven, but will run on-page through modal when supported by the device. The same integration pattern can be used for both redirect and on-page mode. This means that the SDK survives a loss of JavaScript context and can restart itself.

To learn more on how to integrate Klarna leveraging Klarna’s SDK, see Recommended integration: Klarna.js section. Consult the SDK reference for a complete description of the specifications.

Klarna Mobile SDK enables Klarna services to work seamlessly within a native mobile app. The Mobile SDK supports Klarna Payment Services, Klarna Express checkout, Sign in with Klarna, On-Site messaging, and more, using technologies like Kotlin, Swift, JavaScript, and Typescript.

This SDK is the recommended default way to use Klarna products in mobile applications. This is mainly due to the limitations of the WebViews in both iOS and Android. The SDK adds iOS/Android native components and lets Klarna services overcome those issues with a communication between web and native environments.

Note using the Mobile SDK can degrade your Klarna integration and may prevent customers from completing their payments because:

  • Third-party banks and card processors may block or restrict interactions through WebViews. - Cookies in WebViews are handled differently, causing additional friction during checkout.
  • WebViews don’t handle navigation to third-party applications for authorization and authentication, while the Mobile SDK does.
  • The App Handover feature enabled by Mobile SDK allows seamless redirection for authentication and consent within the Klarna app, enhancing security and streamlining processes.
  • The Mobile SDK supports SSO/“Remember me” across apps, enabling shared login and pre-filled customer details, making it easier for returning customers.