Ecosystem

Environments

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.

Endpoints

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

Environment DNS IP Addresses
Live api-global.klarna.com 13.248.252.240, 76.223.28.105
Test api-global.test.klarna.com 3.33.145.71, 13.248.213.183

Callbacks

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

Environment Callback IP Addresses
Live 52.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
Test 34.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

Ensure a high-quality integration

To optimize your integration and prepare for future updates, ensure you are following Klarna’s recommendations:

  • Flexible data handling: implement flexible data parsing that can accommodate additional fields without causing errors or disruptions.
  • Regular updates: stay updated with our latest API documentation and changes. Regular updates to your integration can help leverage new features and enhancements while maintaining compatibility. Klarna will keep you informed about deprecations.
  • Error handling: develop robust error handling mechanisms to manage unexpected API responses or failures gracefully. This minimizes the impact on the customer experience and makes your application more resilient. By adhering to these guidelines and preparing your integration for both backward-compatible changes and keeping your integration up-to-date with the latest API version from Klarna will ensure a seamless interaction with Klarna's evolving API landscape.

Web SDK

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.

Mobile SDK

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.