Troubleshoot guide

This article provides a troubleshooting checklist and FAQ for Klarna Payments in WooCommerce. It helps identify and resolve common setup, configuration, and compatibility issues. The guide also explains frequent error codes and known plugin conflicts to support smooth payment integration.

Link copied!

  1. Check API credentials, environment and currency:
    1. Go to WooCommerce > Settings > Payments > Klarna Payments > Manage > Credentials.
    2. Ensure the correct API keys are configured for the correct region.
    3. Ensure production/live credentials are used only in production, and test credentials in playground.
    4. Before contacting merchant support, please try to generate new API keys from the Klarna Merchant Portal which is done by navigating through the following path: Settings > Klarna API keys > Generate new Klarna API key.
    5. Ensure that the correct API keys are connected to the accurate MID.
  2. Ensure the latest version of the plugin is installed by checking for version releases. Please also verify that your plugin version is compatible with your current versions of WordPress, WooCommerce, and PHP. You can check recent plugin versions and compatibility details here.
  3. A supported country for Klarna Payments must be selected in the WooCommerce checkout form before Klarna Payments is displayed, as can be tested at public WooCommerce Klarna for WooCommerce demo store.
  4. Confirm WooCommerce required settings, such as pretty permalinks, per: https://docs.woocommerce.com/document/klarna-payments/#section-2
  5. The WooCommerce server (your hosting account) must be able to make remote API calls, which can be checked under WooCommerce -> Status -> System and then check the Status: Remote post & Remote get
  6. If a currency switcher plugin is used in the store, the Klarna payment method must be configured within the currency switcher for applicable currencies – Purchase country, locale, and currency. To check which multi currency switchers are compatible with Klarna for WooCommerce, please view Compatible plugins and themes
  7. Check if any logs that are generated under WooCommerce -> Status -> Logs contain an error message like bad value for not having set a terms page in WooCommerce etc.

For further troubleshooting or detailed technical guidance, please refer to the documentation available on our plugin developer’s website here.

400 – Bad Value: purchase_currency

Your account at Klarna doesn’t seem to be configured for the currency used in your store. What currency did you select when you signed up with Klarna? If support is needed, you can email Klarna Merchant support.

401 – Unauthorized

If you receive this error message it usually means that you are using your credentials for the wrong plugin. It could also mean that the username and/or password is incorrect, try copying & pasting instead of typing in directly and double check for whitespace. If you need support, please reach out to Klarna Merchant support.

403 – Invalid_Operations

403 error code means the Klarna credentials authenticate successfully (so Klarna API credentials/username & password are correct) but you haven’t selected the Klarna products to enable these credentials to work yet. This can also show when you should be able to select products in the Klarna Merchant Portal.

403 – Merchant_Inactive

This means that your Klarna credentials are NOT activated.

404 – Not found

This happens when credentials were changed during the order. Please make sure to start a new browser session after changing credentials.

405 – Method not allowed

Merchants are encountering this issue when their Klarna credentials are a valid username & password, but aren’t correctly configured for the market they are using them for.

500 – Internal Server Error

A 5xx error usually indicates a server-side issue. It could be caused by server configuration problems or a fatal error in plugin or theme code. Contact your hosting provider or developer to investigate.

If you suspect a plugin-related error, contact the plugin developer Krokedil and send the following information:

  • WooCommerce logs
  • The fatal error log from the day the issue occurred.

You can find information on how to obtain the logs, as well as other support related information, in the How to prepare a support ticket article.

Why is only one Klarna payment method visible in my checkout?

The Klarna payment methods displayed in the checkout are configured based on your Klarna contract. Changes to the payment methods are updated within Klarna. To add more Klarna payment methods to your contract, contact your Klarna sales contact. To change how the Klarna payment methods are being rendered in your checkout, please reach out to merchant support.

Why do I see orders stuck as Pending payment in WooCommerce?

This has to do with the flow of the order and payment process that works in the following way:

  1. Customer clicks the Place order button in checkout.
  2. The order is created in WooCommerce and gets order status Pending payment.
  3. Order data is sent to Klarna.
  4. If Klarna approves the purchase request, the order status in WooCommerce changes to Processing and the customer is redirected to the order received page.

Orders that are created in WooCommerce, but not successfully created in Klarna (e.g. Klarna declines the authorize call for the customer, for example a card payment where there was not enough funds on the card), will stay in Pending payment status, or will be set to Canceled, in WooCommerce. These orders should not be shipped as the order has not been paid. In the WooCommerce documentation you can learn more about how to setup WooCommerce to automatically cancel unpaid orders after a certain amount of minutes (in the Inventory Options section).

This approach aligns better with the WooCommerce architecture, it is similar to other major payment processors, and removes the option for a Klarna order to be placed without a corresponding WooCommerce order.

Why am I seeing an increased number of failed orders?

Before version 3.9.0 if Klarna held an order for extra fraud checks, the order would remain as On hold even after Klarna reported back that the purchase is rejected. As of version 3.9.0 the order will now be set to Failed instead of remaining as On hold in this case.

If you wish to set a different status for these orders there is a filter you can use.

Why is the order set to On hold when trying to change the status to completed?

This scenario should only be used in edge cases when you know there is a payment in your Klarna merchant portal. The reason for why the order status keeps being set to On hold might be due to missing or mismatched information between the WooCommerce and Klarna order. When it is caused by a mismatch you will see an order note on the WooCommerce order.

First check if the Klarna Order Management metabox is visible in the WooCommerce order and if it is containing information you can follow the guide on how to Disable and enable order synchronization.

If the metabox is not containing information you need to manually handle the order in WooCommerce and in your Klarna merchant portal.

The following steps will turn off Order Management for all orders, so it's recommended to do this when the traffic on the site is lower.

To manually handle the order:

  • Go to WooCommerce → Payments and click on your Klarna payment method. On this page, scroll down to the Klarna Order Management settings.
  • Disable the settings for On order completion and Save the settings. Then you should be able to set the WooCommerce order status to completed and capture the order in the Klarna merchant portal separately.
  • When you are done do not forget to activate the Order Management settings again.

I see a Pending payment order in my WooCommerce order view that does not include any order notes, why is that?

The customer has closed their browser window before completing the authentication modal window with Klarna. These orders should not be shipped as the order has not been paid.

Why am I seeing "Error: BAD_VALUE: order_lines[0].total_tax_amount" in the logs?

When seeing this error:  BAD_VALUE: order_lines[0].total_tax_amount on create_session in the WooCommerce Status logs. Check tax settings and rules and make sure there aren’t 0% tax rules being applied incorrectly (as in this screen shot).

This error can also happen if you have configured WooCommerce to display prices with 2 decimals. More information about displaying of prices and how it can cause rounding issues can be found in this article.

Why do I see the error “Klarna Payments error (Bad value: merchant_urls.terms (must be a valid http or https URI)).” on my checkout page?

This means that you have not set a terms and condition page in WooCommerce.

Go to  WooCommerce > Settings > Advanced and then go to the Page Setup section and make sure you have set a Terms and Condition page there.

If you do have set a page there, go and check (under your Pages section in the WordPress dashboard) that your page that contains your terms and condition information has the Status: Published.

Why do I get “Fatal error: Uncaught Error: Class ‘KP_Api’ not found” after updating the plugin?

If you after updating the plugin get this error: “Fatal error: Uncaught Error: Class ‘KP_Api’ not found in /wp-content/plugins/klarna-payments-for-woocommerce/klarna-payments-for-woocommerce.php:141” it is possible that you could be missing some files.

This means that something in the update process in WordPress did not work as expected, so all files did not get installed properly.

The easiest fix is to delete the plugin and re-install it again from wordpress.org.

Why do I get “Fatal error: Uncaught Error: Call to undefined method get_shipping_phone” after updating the plugin?

This means your WooCommerce version is too old and you need to update to at least match the required version.

How do I add attachments or EMD to a Klarna order?

Here is example code that you can follow. Remember, this is only an example and not code that is to be used live. You will need to change the data and attachment type that you send to Klarna.

You can find more information about this here: https://docs.klarna.com/api/payments/#operation/createCreditSessionKlarna Icon

PHP

Copied

/**
 * Example code for how to add EMD to the KP request args.
 * Please check https://docs.klarna.com/api/payments/#operation/createCreditSession 
 * for the exact attachment you need.
 * This is only an example code; you might need to change some of the data 
 * or logic based on your own needs.
 */

add_filter( 'wc_klarna_payments_create_session_args', 'kp_add_emd' );
add_filter( 'wc_klarna_payments_update_session_args', 'kp_add_emd' );

When I click on the Place Order button it just reloads the page, what is wrong?

The cases identified so far when this is happening is a plugin compatible issue with another plugin. The plugin seen when troubleshooting this is the multilingual plugin WeGlot.

To get the checkout to work properly you need to exclude the checkout URL in the WeGlot settings:

​After this has been done you will see the Klarna modal window pop-up again when clicking on the Place Order button.

My payment ways is not displayed on the checkout page and I see this error message in the browsers console log: PaymentMethodCategoryNotSupportedError, what is wrong?

The WooCommerce Klarna Plugin is expecting WooCommerce checkout radio button in certain places in the DOM (that follows the WooCommerce standard) that looks like it might been changed in your checkout. This is often due to theme and plugin changes.

Can I combine the WooCommerce cart and checkout pages by entering both shortcodes on the same page?

No, you should not do this. WooCommerce has two different pages for cart and checkout. Some store owners want to reduce the steps for the customer to be able to complete an order, but this can cause conflicts and errors, and also look strange.

If you only want one page for checkout and cart, it's suggested that you remove the cart page from the equation and add functionality to change products in the shopping cart on the checkout page.

Can I change the name, description or Klarna icon of the payment method in Klarna?

This information is sent to to the plugin by Klarna, who controls the payment method name, view and description. These can not be configured or customized by the merchant.

Automate Dropshipping for B2B Dropshipper (WWTech)

When a customer press the Pay button, the payment form information is sent to Klarna. This requires parsing the payment form, and packaging the data in a specific format. This uses WooCommerce standard, and is referred to as seralization.

The Automate Dropshipping plugin injects custom code when the payment form is serialized. This causes an AJAX error because a HTML script tag is inserted into the request as it's preparing to be sent. The outcome is that the data will be malformed and the result is an “internal server error” on the checkout page.

Flexible Checkout Fields PRO (WP Desk)

Conflicts with Klarna Payments in the checkout and throws an “Invalid JSON in logic_results_storage” which prevents the checkout from working properly. It might be a certain setting that causes this, so if you use this plugin it’s good the be aware of this (potential) problem.

Germanized & Germanized PRO

– Conclusion of Contract (PRO-feature)
It is a known issue that enabling  Conclusion of Contract in Germanized’s Manual contract option will result in Klarna’s confirmation page being missing after a customer completes a purchase in Klarna Checkout and Klarna Payments.

German Market

  • Confirm & Place Order Page

If this feature is activated, clicking Buy now to complete the purchase on the checkout page will cause the customer to be redirected to a confirmation page. Here they’re asked to accept terms and conditions and make sure their billing and shipping information is correct, before they can proceed to completing the order.

Clicking the button Place binding order to complete the order will redirect the merchant to the checkout page again. This is repeated forever, trapping the customer in a pay-confirm loop.

Note: The reason for this is that the plugin very heavily relies on JavaScript and JavaScript events. When the page is changed to the confirmation page, and then sent back to the checkout page, a lot of the events that got registered are no longer there, hence the plugin can’t respond to them properly.

  • Add-on: Temporary Tax Reduction

Error: Bad value: order_lines[0].total_tax_amount

Solution: Use the standard WooCommerce tax options to add the new temporary tax instead during the temporary time.

  • Force to use German Market Checkout Template

If this option is enabled, Klarna Payments won’t be able to display on the checkout page.

Gift Cards for WooCommerce

  • Bad order amount when using Gift Card Balance

There is an issue when a customer has added a giftcard to their account and select the option “Use amount X from your gift cards balance”. This results in a Bad value: order_amount error.

This error also appears when using other payment method, such as Direct bank transfer, hence it is not a Klarna related issue

  • Refunding the whole initial order amount

It appears that orders containing WooCommerce Gift Cards encounter issues when refunding the full order amount.

This is not specific to Klarna for WooCommerce, but also occurs with other payment methods such as bank transfer.

Measurement Price Calculator

Klarna requires that a quantity must be an integer, which means that if a customer buys e.g. 0.5 meters of a product, this will be interpreted as 0 meters by Klarna.

To avoid this problem you should configure the Measurement Price Calculator (MPC) to use a different unit of measurement for the calculations as to what is displayed to the customer.

In the case of this example you still wish to have the product measurements displayed in meters, but in the backend you tell MPC to use a smaller unit of measurements, e.g. cm. This way a customer can buy 0.5 meters, as the price is calculated on 50 (cm) instead of 0.

From the customer’s perspective they will still see the measurements displayed as they are used to with a certain type of product. It is only in the hidden calculations that a different unit of measurement will be used.

Just remember to adjust the price of your calculations to match the smaller unit as well.

Payment Plugins for Stripe WooCommerce

Some merchants using this plugin in conjunction with Klarna for WooCommerce has experienced problems regarding sending a lot of empty order lines.

Smart Coupons

  • Smart Coupons has updated its logic, which means that gift cards can only be supported when the setting "Deduct credit/gift before doing tax calculations" is enabled.
  • Full refunds are not possible if the Apply Before Tax option in the Smart Coupons settings is not enabled. This limitation is not caused by the plugin, but is also present when using WooCommerce’s standard BACS payment method.

Woo Stripe

When using the Stripe for WooCommerce plugin, enabling Klarna via that plugin and also using the Klarna for WooCommerce plugin can cause conflicts. The solution here is to only use one of the plugins since the use of two plugins implementing the same payment method is contradictory.

WOOF WooCommerce Product Filters

Error: The product filter script runs on the checkout, and because an anchor tag / link is used to produce the 3DS bank authorization form, it causes the checkout to reload.

Solution: Within the plugin, go to Advanced, then scroll down to Init plugin on the next site pages only (this allows you to list the site pages where you want the script to run. Leaving it empty means the script runs on all pages). Enter one URL per row. Click Save changes.

WooCommerce AvaTax

When using the plugin WooCommerce Avatax the Update order function will not work in Klarna Order Management. If you want to update the order you need to handle this manually in both WooCommerce and the Klarna Merchant Portal.

When updating an order:

Make sure you turn off the update function On order update in the Klarna Order Management settings before you make any changes to the order in WooCommerce. Then make the same changes to the order in the Klarna Merchant Portal.

When setting an order to Completed:

You also need to turn off the update function On order completion in the Klarna Order Management settings before you change the the order status to Completed in WooCommerce. This order status also needs to be handled manually in both WooCommerce and the Klarna Merchant Portal.