Klarna Docs - Release Info and FAQ
Release Info and FAQ

Some releases require sharing additional important information, documented below.

Release notes for every version are available for the Klarna extension here.

Version 3.0.0 was released July 2024.

Below are backward-incompatible changes that may have a major impact for some sites, particularly to ensure third-party modules continue working.

What ChangedHow It Changed
Klarna\Backend\Api\ApiInterface"Updated constructor signature", Public methods "Updated signature"
Klarna\Backend\Model\Api\FactoryPublic methods "Updated signature"
Klarna\Kco\Api\KasperInterfacePublic methods "Updated signature"
Klarna\Kco\Api\ApiInterfacePublic methods "Updated signature"
Klarna\Kco\Model\Api\Factory"Updated constructor signature"
Klarna\Kco\Model\Api\KasperPublic Methods "Updated signature"
Klarna\Kco\Model\Api\Builder\KasperPublic methods "Updated signature", "Update constructor signature"
Klarna\Kp\Api\Data\RequestInterfacePublic methods: "Added", "Removed", "Updated signature"
Klarna\Kp\Api\CreditApiInterfacePublic methods "Updated signature"
Klarna\Kp\Controller\Klarna\AuthorizeUpdated constructor signature"
Klarna\Kp\Controller\Klarna\Cookie"Updated constructor signature"
Klarna\Kp\Controller\Klarna\QuoteStatus"Updated constructor signature"
Klarna\Kp\Controller\Klarna\UpdateSession"Updated constructor signature"
Klarna\Kp\Model\PaymentMethods\PaymentMethodProvider"Updated constructor signature"
Klarna\Kp\Model\PaymentMethods\TitleProviderPublic methods: "Removed"
Klarna\KpGraphQl\Model\Resolver\CreateKlarnaPaymentsSession"Updated constructor signature"
Klarna\Logger\Cron\CleanLogs"Updated constructor signature"
Klarna\Orderlines\Model\Calculator\GiftWrapPublic methods "Updated signature", "Update constructor signature"
Klarna\Orderlines\Model\Calculator\ItemPublic methods "Updated signature", "Updated constructor signature"
Klarna\Orderlines\Model\Calculator\ItemShippingAttributesPublic methods "Updated signature", "Updated constructor signature"
Klarna\Orderlines\Model\Calculator\Shipping"Removed constructor signature"
Klarna\Orderlines\Model\Items\Items"Updated constructor signature"

Klarna\Backend\Api\ApiInterface

DIFF
      *
      * @param StoreInterface $store
      * @param string         $methodCode
+     * @param string         $currency
      * @return $this
      */
      public function resetForStore(
	      $store,
	      $methodCode,
+	      string $currency

Klarna\Backend\Model\Api\Factory

DIFF
     /**
-     * @param ObjectManagerInterface $objectManager
-     * @param KlarnaConfig           $klarnaConfig
+     * @param OrderManagement        $ordermanagement
      * @codeCoverageIgnore
      */
      public function __construct(
-		  ObjectManagerInterface $objectManager,
-		  KlarnaConfig $klarnaConfig
+		  OrderManagement $ordermanagement
DIFF
-     public function create($className)
DIFF
     /**
      * @param string         $methodCode
      * @param StoreInterface $store
+     * @param string         $currency
      * @return ApiInterface
      * @throws LocalizedException
      */
      public function createOmApi(
	      string $methodCode,
	      StoreInterface $store = null

Klarna\Kco\Api\KasperInterface

DIFF
     /**
      * Get Klarna order details
      *
      * @param string $id
+     * @param string $currency
      * @return array
      */
-     public function getOrder(string $id): array;
+     public function getOrder(string $id, string $currency): array;
DIFF
     /**
      * Create new order
      *
      * @param array $data
+     * @param string $currency
      * @return array
      */
-     public function createOrder(array $data): array;
+     public function createOrder(array $data, string $currency): array;
DIFF
     /**
      * Update Klarna order
      *
      * @param string $id
      * @param array $data
+     * @param string $currency
      * @return array
      * @throws KlarnaApiException
      */
-     public function updateOrder(string $id, array $data): array;

Klarna\Kco\Api\ApiInterface

DIFF
    /**
     * Retrieve order in the checkout API
     *
+    * @param string $currency
     * @param string|null $checkoutId
     * @return DataObject
     */
-    public function retrieveOrder($checkoutId = null);
+    public function retrieveOrder(string $currency, $checkoutId = null);

Klarna\Kco\Model\Api\Factory

DIFF
     /**
      * Construct
      *
-     * @param \Magento\Framework\ObjectManagerInterface $objectManager
-     * @param KlarnaConfig                              $klarnaConfig
+     * @param Kasper                                    $kasper
      * @codeCoverageIgnore
      */
      public function __construct(
-         \Magento\Framework\ObjectManagerInterface $objectManager,
DIFF
-    public function createModel($className)

Klarna\Kco\Model\Api\Kasper

DIFF
     /**
      * Get order from API
      *
+     * @param string $currency
      * @param string|null $checkoutId
      * @return array|DataObject
      * @throws KlarnaApiException
      * @throws KlarnaException
      */
-     public function retrieveOrder($checkoutId = null)

Klarna\Kco\Model\Api\Builder\Kasper

DIFF
     /**
-     * @param ConfigHelper                                $configHelper
-     * @param Klarna\Kco\Model\Configuration\Url         $urlConfiguration
+     * @param KcoUrl                                      $urlConfiguration
      */
      public function __construct(
	     ...
-        ConfigHelper $configHelper,
-        Checkout $checkoutConfiguration = null,
-        Prefill $prefillConfiguration = null,

Klarna\Kp\Api\Data\RequestInterface

DIFF
-   /**
-     * Setting the options
-     *
-     * @param OptionsInterface $options
-     */
-     public function setOptions(OptionsInterface $options
DIFF
+    /**
+     * Getting back the purchase currency
+     *
+     * @return string
+     */
+     public function getPurchaseCurrency(): string;

Klarna\Kp\Api\CreditApiInterface

DIFF
     /**
      * Creating the session
      *
-     * @param RequestInterface $request
+     * @param Container $container
      * @return ResponseInterface
      */
-     public function createSession(RequestInterface $request);
+     public function createSession(Container $container);
DIFF
     /**
      * Updating the session
      *
-     * @param string           $sessionId
-     * @param RequestInterface $request
+     * @param Container $container
      * @return ResponseInterface
      */
-     public function updateSession(string $sessionId, RequestInterface $request);
+     public function updateSession(Container $container);
DIFF
     /**
      * Reading the session
      *
-     * @param string           $sessionId
+     * @param Container $container
      * @return ResponseInterface
      */
-     public function readSession(string $sessionId);
+     public function readSession(Container $container);
DIFF
     /**
      * Placing the order
      *
-     * @param string           $authorizationToken
-     * @param RequestInterface $request
-     * @param null|string      $klarnaId
-     * @param null|string      $incrementId
+     * @param Container $container
      * @return ResponseInterface
      */
DIFF
     /**
      * Cancelling the order
      *
-     * @param string $authorizationToken
-     * @param null   $klarnaId
+     * @param Container $container
      * @return ResponseInterface
      */
-     public function cancelOrder(string $authorizationToken, $klarnaId = null);
+     public function cancelOrder(Container $container);

Klarna\Kp\Controller\Klarna\Authorize

DIFF
    /**
      * @param RequestInterface $request
      * @param LoggerInterface $logger
      * @param AuthorizeLogger $authorizeLogger
      * @param CartManagementInterface $cartManagement
-     * @param CartRepositoryInterface $magentoQuoteRepository
      * @param RequestValidator $requestValidator
+     * @param CartRepositoryInterface $magentoQuoteRepository
      * @codeCoverageIgnore
      */

Klarna\Kp\Controller\Klarna\Cookie

DIFF
    public function __construct(
        Session                  $session,
        UrlInterface             $urlBuilder,
        DefaultConfigProvider    $defaultConfigProvider,
        RedirectFactory          $redirectFactory,
-       QuoteRepositoryInterface $klarnaQuoteRepository = null,
-       Logger                   $logger = null,
-       RequestInterface         $request = null
+       QuoteRepositoryInterface $klarnaQuoteRepository,
+       Logger                   $logger,

Klarna\Kp\Controller\Klarna\QuoteStatus

DIFF
    public function __construct(
        RequestInterface $request,
        QuoteRepositoryInterface $klarnaQuoteRepository,
        CartRepositoryInterface $magentoQuoteRepository,
        Result $result,
-       LoggerInterface $logger = null
+       LoggerInterface $logger
     )

Klarna\Kp\Controller\Klarna\UpdateSession

DIFF
    public function __construct(
        RequestInterface $request,
        QuoteRepositoryInterface $klarnaQuoteRepository,
        Result $result,
        OrderRepositoryInterface $magentoOrderRepository,
        CheckoutSession $checkoutSession,
-       LoggerInterface $logger = null
+       LoggerInterface $logger
     )

Klarna\Kp\Model\PaymentMethods\PaymentMethodProvider

DIFF
     /**
      * @param PaymentFactory $methodFactory
-     * @param null|QuoteRepositoryInterface $klarnaQuoteRepository
+     * @param QuoteRepositoryInterface $klarnaQuoteRepository
      * @codeCoverageIgnore
      */
-     public function __construct(
		  ...
-         $klarnaQuoteRepository = null
+		  QuoteRepositoryInterface $klarnaQuoteRepository

Klarna\Kp\Model\PaymentMethods\TitleProvider

DIFF
-    public function isDefaultTitle(QuoteInterface $klarnaQuote, string $paymentMethod): bool

Klarna\KpGraphQl\Model\Resolver\CreateKlarnaPaymentsSession

DIFF
    public function __construct(
        GetCartForUser $getCartForUser,
        RequestInterface $request,
        Validation $validation,
        Action $action,
        MagentoSession $magentoSession,
        CustomerSession $customerSession,
-       ApiValidation $apiValidation = null
+       ApiValidation $apiValidation
     )

Klarna\Logger\Cron\CleanLogs

DIFF
     /**
-     * @param ScopeConfigInterface  $config
-     * @param StoreManagerInterface $storeManager
-     * @param LogCollection         $logCollection
-     * @param LogRepository         $logRepository
-     * @param LogCollectionFactory  $logCollectionFactory
-     * @param LoggerInterface       $logger
+     * @param LogCollectionFactory $logCollectionFactory
      * @codeCoverageIgnore
      */
DIFF
+    /**
+     * Its a public method so that it can be extended by other modules.
+     *
+     * @return int
+     */
+    public function getLogLifeTime(): int
+    {
+        return self::LIFT_TIME;
+    }

Klarna\Orderlines\Model\Calculator\GiftWrap

DIFF
    /**
-     * @param KlarnaConfig $klarnaConfig
      * @param DataConverter $dataConverter
      * @param Calculation $calculator
      * @param ScopeConfigInterface $scopeConfig
+     * @param Country $country
      * @codeCoverageIgnore
      */
     public function __construct(
-        KlarnaConfig $klarnaConfig,
DIFF
     /**
      * Processing the item
      *
-     * @param array          $itemToProcess
-     * @param int            $itemQty
-     * @param StoreInterface $store
-     * @param string         $itemType
+     * @param array $itemToProcess
+     * @param int $itemQty
+     * @param string $itemType
DIFF
      *
      * @param DataHolder $dataHolder
      * @param string $itemType
+     * @param ExtensibleDataInterface $object
      * @return array|null
      * @throws Klarna\Base\Exception
      */
	  public function getItem(
+	      ExtensibleDataInterface $object
	  )

Klarna\Orderlines\Model\Calculator\Item

DIFF
     /**
      * @param DataConverter   $helper
-     * @param KlarnaConfig    $klarnaConfig
      * @param Config          $taxConfig
      * @param LoggerInterface $logger
+     * @param Country         $country
      * @codeCoverageIgnore
      */
     public function __construct(
         DataConverter $helper,

Klarna\Orderlines\Model\Calculator\ItemShippingAttributes

DIFF
     /**
      * @param ScopeConfigInterface $scopeConfig
+     * @param ShippingOptions      $shippingOptions
      * @codeCoverageIgnore
      */
      public function __construct(
+          ShippingOptions $shippingOptions
      )
DIFF
      *
      * @param ProductInterface $product
      * @param float            $dimensionCalculator
-     * @param string           $stat
+     * @param string           $attributeCode
      * @return float
      */
      private function getProductStat(
-         string $stat
      ): float
DIFF
-    public function getMappedShippingAttribute(StoreInterface $store, string $dimensionCode): string

Klarna\Orderlines\Model\Calculator\Shipping

DIFF
-    /**
-     * @param Calculation          $calculator
-     * @param ScopeConfigInterface $scopeConfig
-     * @codeCoverageIgnore
-     */
-     public function __construct(Calculation $calculator, ScopeConfigInterface $scopeConfig)

Klarna\Orderlines\Model\Items\Items

DIFF
     /**
      * @param ItemCalculator $calculator
      * @param ItemShippingAttributes $attributes
      * @param CollectionFactory $collectionFactory
-     * @param ItemResolverInterface|null $itemResolver
+     * @param ItemResolverInterface $itemResolver
+     * @param ShippingOptions $shippingOptions
      * @codeCoverageIgnore
      */
     public function __construct(

The configuration structure was revised in this release, to better support merchants integrating Klarna Payments via a PSP sub partner, using Klarna's Conversion booster features, such as On-site messaging, Express checkout, or coming soon Sign in with Klarna, and also still support sites integrating Klarna Payments directly. API credentials for each region are newly available at the Default Config scope. Credentials are separate into a specific section, and apply equally across all the other Klarna product sections. With Adobe Commerce's inheritance architecture, credentials can still be configured in other scopes as desired, but the intention is to simply configurations for sites supporting multiple regions.

Incompatibilities

The following extensions may cause issues with Klarna:

  • non-standard checkouts (e.g. one page checkouts) may not be compatible. While the extension code is built for compatibility whenever possible, it is only guaranteed and supported for compatibility with standard Adobe Commerce checkout.
  • Amasty offers many extensions for Adobe Commerce, but some of them have incompatibilities. For example, in Amasty’s Store Pickup with Locator extension, where shipping fees are altered by Amasty code after the Klarna order is created rather than after the order has been invoiced, resulting in a Klarna capture that may not match the created Klarna order. To get help with this issue, contact Amasty support.
  • Innoship may block payment methods. If Klarna isn't displaying in checkout, try deactivating Innoship to confirm if it's the root cause.

502 loop errors

While uncommon, some shops using Klarna Payments encounter a looping problem (when quote.trigger_recollect=1) with Klarna Checkout (module-kco) code that is included in the m2-klarna bundled extension. The module-kco code cannot currently be fully disabled in the bundled extension when Klarna Payments is active, but to resolve the 502 errors for an individual shop, the extension code can be updated to comment out the module-kco & module-kss code, e.g. by modifying the Model/Checkout/Kco/Session.php code. [PPP-1406]

You can’t use both Klarna payments and Klarna checkout on the same website. You can use it in the same Adobe Commerce instance as long as you set up separate websites and if your Klarna contract allows you to use both products. To learn more,  contact your Klarna account manager or solutions engineer. If you don’t have a contract with Klarna yet, contact a Klarna sales representative.

We display the payment method name returned to us by the API. The payment method name is driven by Regional Product and Marketing. You can’t change it at the merchant level.

Adobe Commerce uses a base currency that is, along with tax settings, configured at the website level and not store view. To avoid rounding and mismatch issues, we only work with base currency and don’t support using display currency (which is used by the currency switcher). If you want to support multiple currencies, you need to set up multiple websites with different URLs, configured in Adobe Commerce at the website level, not store view, for each currency.

You can find this configuration in the following menus in the Admin:

  • Stores > Configuration > General > General > Country Options > Allow Countries
  • Stores > Configuration > Sales > Payment Methods > Klarna > Klarna Checkout > Shipping Countries

Bulk capture isn’t supported natively by Adobe Commerce. Because of this, many merchants build this functionality into Adobe Commerce custom. There is no standard way to implement bulk capture, so we have no way of building our code to support this. If Adobe Commerce ever releases support for this natively in the platform, we will add full support for it as well.

The below tax configuration is necessary for tax to be calculated and communicated properly between Adobe Commerce and Klarna.

To change the tax settings, go to Stores > Configuration > Sales > Tax, then change the settings applicable for your store:

General tax calculation

  • Tax Calculation Based On should be set to Shipping Address
  • Apply Customer Tax must be set to After Discount

Tax calculation for non-US countries 

  • Tax Calculation Method Based On should be set to Row Total
  • Catalog Prices must be set to Including Tax
  • Shipping Prices must be set to Including Tax 
  • Apply Discount on Prices must be set to Including Tax

Tax calculation for the US

  • Tax Calculation Method Based On should be set to Unit Price
  • Catalog Prices must be set to Excluding Tax
  • Shipping Prices must be set to Excluding Tax
  • Apply Discount on Prices must be set to Excluding Tax

Discounts are usually shared with Klarna as part of the appropriate order line item, not as an individual separate discount type order line item. 

However, there are exceptions, for example, when Klarna shipping assistant is active and the discount impacts shipping.

Starting from version 2.4.3, released August 2020, Klarna logs are accessible directly in the Adobe Commerce Admin. If you have the Klarna extension for Adobe Commerce installed in your shop, you can find Klarna API logs using the steps below. When requesting support from Klarna, please share the related logs files covering the timeframe of the issue. (To avoid sharing customer personal identifiable information, note the configuration setting under "API Configuration" for "Logging general information", which is recommended to be set to "Disable" for production.)

To get the Klarna API logs from the Admin:

  1. Login to the Dashboard/Admin panel.
  2. On the left side of the screen, click on the gear icon labeled SYSTEM.

3. In the Klarna section, click Logging.

4. From the list of displayed logs, in the Action column, click View next to the operation for which you want to see the logs. For sharing logs, e.g. for Klarna support, you can Export the logs to a file.

Each Klarna API request is also available in the Developer logs app in the Klarna merchant portal.

For Adobe Commerce versions earlier than 2.4.3, logs are stored on a merchant's server in the var/log folder within root Adobe Commerce installation.

Additionally, exception log files, for example, exceptions.log and klarna_api.log, are stored on the server under {shop base path}/var/log.

After changing any shop configuration settings that may impact the data related to the shop's Klarna integration, make sure to clear the shop's cache of stored data, under SYSTEM > Cache Management.

The Klarna extension (klarna-m2-klarna) is the recommended one. It includes both Klarna payments and Klarna checkout, as well as On-site messaging, Order management, and Express button.

While the Klarna checkout extension (klarna-m2-checkout) is still available on the Adobe Commerce Marketplace, it’s not updated with the latest functional changes. It’s still available for shops that already use this extension, but bug fixes and support are done only for the recommended klarna-m2-klarna extension.

Adobe Commerce has moved to the industry standard of using Composer to install packages. This is Adobe Commerce's preferred solution that is recommended to all third-party partners. As such Klarna only provides the install using this method. Using composer allows us to specify external requirements our modules rely on and have those installed automatically for the merchant,as opposed to the merchant having to do additional steps to install our modules.The zip file that is downloaded is only the meta-package for our extension and isn’t something Klarna has a way of turning off.The zip file is shown for all extensions regardless of if they are m1 or m2, however they are really more relevant for m1 extensions.

To use Klarna checkout just in one country, disable it at the default scope and enable it at the website scope for the market where you want to offer Klarna checkout.

You should perform all order management operations in Adobe Commerce. For changes done within the shop, updates are synced with Klarna data, but when doing updates in the Klarna merchant portal, there is no sync with the shop data.

If this is for a physical item being ordered, please make sure the customer is being presented with shipping options. If no shipping options are offered, Adobe Commerce will reject the order, causing the extension code to cancel the order. 

If you offer different shipping methods by region, please make sure you also offer a fallback shipping option that covers the entire country so that if a customer enters a shipping address for which the shop doesn’t have regional options, the customer will at least be presented with the fallback option.

Most often orders are canceled due to a shipping mismatch between the placed Klarna order and the shop order, but there could be other root causes. To determine the root cause, review the log files.

There are multiple reasons why the Klarna checkout iframe and redirects don’t work correctly:

  • The shop isn’t reachable from outside. Even for local development, your shop must be publicly accessible. Use a service such as https://ngrok.com.
  • The shop isn’t using an HTTPS address.
  • The store’s SSL certificate is self-signed. Self-signed certificates won’t work with the Klarna extension. Use a certificate authority, for example, Let's Encrypt, to get your store’s certificate signed.
  • The website is secured with a password.
  • If you’re allowlisting specific IP addresses, note that we use AWS, so you would need to allowlist all of AWS. We recommend that you don’t use IP allowlisting, instead allowing all traffic to any URL that contains /klarna/ or /kco/. If you really have to allowlist IPs, refer to Amazon's documentation on IP address ranges.

If you’re using Klarna shipping assistant, check that it's enabled in the Admin.

If you get an error using composer to install the klarna-m2 extension, similar to error messages below, verify that you are using the same public and private keys associated with the Adobe Commerce account which was used to order the extension from the Adobe Commerce Marketplace. It’s required that these keys are the same ones as those used to install Adobe Commerce. (Also, make sure to clear the cache after any changes.)
If you’re still having issues installing the extension, please contact the Adobe Commerce Marketplace support for assistance in getting access to the extensions which were purchased.

Installation failed reverting ./composer.json

Your requirement could not be resolved to an installable set of packages

[InvalidArgumentException] Could not find a matching version of package klarna/m2-klarna.

Make sure the tax configuration matches the supported settings.

The "validation_service_failed" error means that the order validation that happens between Klarna and the shop failed. Klarna will send a callback to the merchant’s system prior to redirecting the consumer to the success page. This callback is what reported the error. If you have the debug mode enabled, you should be able to review your klarna_*.log files to see what error was reported.

The “No such entity” error isn't expected in versions later than 2.3.6 and 2.4.1. Upgrading to a later version of Adobe Commerce should resolve the error.

If an error message states that a shipping option is unavailable, check the following:

  • Check if the shop is publicly accessible. If not, make it available on a public site or tunnel to interact with Klarna checkout.
  • Make sure there are no firewall rules that can block requests to Klarna.
  • Make sure there are no third-party extensions that can interfere with Klarna checkout.

Check the value in the customer address setting and set it to at least 2 lines:

  • In Enterprise edition (EE), go to Stores > Customer Address Attributes > Street > Lines Count setting
  • In Community edition (CE), go to Stores > Configuration > Customers > Customer configuration > Name and Address options > Number of Lines