This guide explains how to install and configure the Klarna Order Management (OMS) app for Salesforce Order Management (SFOMS). Merchants can access required adapters and code directly from the Klarna GitHub repository, where the open-source code is available for deployment into the SFOMS environment like any other customization.
The Klarna Order Management (OMS) App enables you to integrate Klarna’s payment services This documentation is designed for developers who will download, customize, and promote the code to production as part of their development lifecycle. It provides template flows and code samples that developers can use to integrate Klarna's payment adapters and 'invocable' code components. The integration options are designed to support efficient orchestration within Salesforce flows, helping developers decide on the most effective integration strategy.
To use the Klarna OMS app with SFOMS, ensure the following are in place:
Once these prerequisites are complete, you’re ready to proceed with the Klarna OMS App setup and configuration.
To get started with Klarna's Salesforce Commerce Cloud (SFCC) Order Management integration, download the required app from Klarna's GitHub repository. This repository contains all necessary files and documentation to facilitate seamless integration.
Follow these steps to set up the Klarna app in Salesforce Order Management (SFOMS):
KLA_KlarnaAdapter
. Ensure the Idempotency
Supported flag is enabled.kpOrderID
and lineItemJSON
fields under Orders, Order Summaries, Order Products, and Order Product Summaries in Object Settings.SFOMS integrates with Salesforce Flow, providing templates to streamline common processes like order creation, fulfillment, and servicing. Some templates may require a Starter or Growth license. The available templates include:
For more details on configuring Order Management flows, refer to the Salesforce Order Management Flow Configuration Guide.
This repository includes code for a Klarna payment adapter that can be deployed in your SFOMS Sandbox environment. Once integrated, this adapter can be orchestrated within your flows as needed.
KLA_KlarnaAdapter
Class:KLA_KlarnaAdapter
class manages payment captures and refunds within the flow orchestrations. You can locate it at force-app/main/default/classes/KLA_KlarnaAdapter.cls
.KLA_KlarnaAdapter_Test
, is available at force-app/main/default/classes/KLA_KlarnaAdapter_Test.cls
. This is a template class that can be adapted to meet specific requirements.For more information on payment adapter configuration, refer to the Salesforce Developer documentation.
In addition to the Payment Adapter Class, the Klarna SFOMS package includes custom Invocable Actions that allow merchants to control key order management functions, such as updating orders or canceling transactions, directly within flows. The following recipes illustrate how these invocable actions can be integrated into your existing flows:
KLA__OrderUpdateAmount_Invocable
: This action is used to modify the order amount and order lines within an existing flow. Pass the Order Summary ID as the input. The class can be found at force-app/main/default/classes/KLA_OrderUpdateAmount_Invocable.cls
. The associated test class is KLA_Coverage_Test.cls
.KLA__OrderCancellation_Invocable
: This action is used to cancel orders and order items within a flow. Similar to the update action, it requires the Order Summary ID as input. This class is located at force-app/main/default/classes/KLA_OrderCancellation_Invocable.cls, with the corresponding test class also in KLA_Coverage_Test.cls.For implementation, reference the classes and test files in the repository as templates for customization.
sf org login web --alias sandboxOrg --instance-url https://test.salesforce.com
sf project deploy start --source-dir force-app --target-org sandboxOrg
sf project deploy start --source-dir force-app --target-org prodOrg