Klarna Order Management

Klarna Order Management

Introduction


When an order is created in WooCommerce and a order number exists in Klarnas system, you have the possibility to handle the order management in Klarna directly from WooCommerce. This way you can save time and don’t have to work in both systems simultaneously.

Support

English: use the support form on krokedil.com to get help.

Svenska: använd supportformuläret på krokedil.se för att få hjälp.

Helpful information before you contact us can be found in the How to prepare a support ticket article.

Useful internal links

Technical information – plugin data and changelog

Useful external links

English product page on krokedil.com

Svensk produktsida på krokedil.se




Requirements


You need to have either Klarna Checkout for WooCommerce or Klarna Payments for WooCommerce installed and configured to use Klarna Order Management.


Installation


There are three ways to install Klarna Order Management.

Option 1 – via the WordPress plugin uploader:

  1. Download the .zip file via this download link
  2. Go to: WordPress Admin → Plugins → Add New and upload the file via Upload plugin.
  3. Install Now and Activate.

Option 2 – via the WordPress plugin installer:

  1. Go to: WordPress Admin → Plugins → Add New and do a Keyword search for Klarna Order Management.
  2. Install Now and Activate.

Option 3 – via the Klarna Add-ons menu in WooCommerce:

  1. Go to: WordPress Admin → WooCommerce → Klarna Add-ons
  2. Click on Not installed to install and then Activate.

Order management settings


You can find the settings for the Klarna Order Management for WooCommerce on the same page as the settings for your Klarna payment method.
Go to WooCommerce → Payments and click on your Klarna payment method. At the bottom of this page you will find the settings for your installed Klarna Add-ons

Here you can see all the settings available for the plugin.

On order completion: This setting will enable the automatic capture of a Klarna order when the relevant WooCommerce order is set to Completed.

On order cancel: This setting will enable the automatic canceling of a Klarna order when the relevant WooCommerce order is set to Canceled.

On order update: This setting will enable the automatic update of a Klarna order when the relevant WooCommerce order is updated before it has been Captured or Canceled.

On order creation (manual): This setting will make it possible to automatically fetch the customers address from a manually created admin order if there is a Klarna order ID added as the transaction id. You can read more about this in the Klarna sellers app integration part of this document.

Force capture full order: This setting will force the capture of any remaining amount in the Klarna order, instead of capturing each order line separately. Useful if the Klarna order has been updated by an ERP (Enterprise Resource Planning) system.

Debug log: This setting will enable that debug messages are saved in the WooCommerce System Status log.


Cancel an order


  1. The WooCommerce order status need to be set as Processing.
  2. Go to the order edit screen by navigate to WooCommerce → Orders and click on the order you want to edit.
  3. In the Order details box there is a selectbox named Status. Change the status to Cancelled.
  4. Click the Update button located at the top right on the screen.
  5. If everything was successful a new order note saying Klarna order cancelled is created.

Update an order


Please also note that the Klarna system does not accept all order updates. Increasing the order amount will likely not be approved, and instead the customer should place a new order. For additional support regarding that, please contact Klarna merchant support.

There is a known compatibility issue between WooCommerce AvaTax and Klarna Order Management. You can read more about this further down on this page.

  1. The order status should not have been set to Completed yet (no activation number should exist for the order in Klarnas system).
  2. Go to the order edit screen by navigate to WooCommerce → Orders and click on the order you want to edit.
  3. In the Order details box there is a selectbox named Status. Change the status to On hold.
  4. Click the Update button located at the top right on the screen.
  5. Edit the order item lines by first clicking Edit item.

    Make the changes, in this example we lower the price Total for the purchased product.
    Click the Save button below the order items box.

    After you have pressed the Save button you need to make sure that the tax amount is correct and corresponds with the new price. Make sure that all order line tax fields adds up to the same amount as the total tax. If it doesn’t – click Recalculate.

It is important that you verify that the changes you have made to your order are visible in your Klarna Merchant Portal before you move on to the next step.

  1. Change the status to Processing in the same way as in step 3.
  2. Press the Update button as seen in step 4.
  3. The order is now updated, both in WooCommerce and Klarna’s system.

Capture an order


  1. The WooCommerce order status need to be set as Processing.
  2. Go to the order edit screen by navigate to WooCommerce → Orders and click on the order you want to edit.
  3. In the Order details box there is a selectbox named Status. Change the status to Completed.
  4. Click the Update button located at the top right on the screen.
  5. If everything was successful a new order note is created with information about the invoice number

The module does not support partial captures.


Refund an order


  1. The WooCommerce order status need to be set as Completed.
  2. Go to the order edit screen by navigate to WooCommerce → Orders and click on the order you want to edit.
  3. In the Order items box, press the Refund button.
  4. Here you can choose to refund the full sum for an item (1), part of the sum (2) or shipping (3).
    If you enter a sum manually (2) you also need to enter the correct tax to refund manually, as opposed to when you refund the full sum for an item in which case the tax is automatically calculated. With shipping (3) you need to enter the amount manually, as well as the tax. Not to be confused with the Refund manually button.
  5. Press the Refund via Klarna button.
  6. If everything was successful a new order note is created with information about the refund in Klarnas system.

Disable and enable order synchronization


By default, order synchronization is always enabled. It is however possible to turn off order synchronization between WooCommerce and Klarna via a setting in the Klarna Order Management metabox.

When disabled, you can modify the WooCommerce order in any way (e.g., change order status, modify order lines) without effecting the corresponding Klarna order.

When disabled any changes in either system will have to be done manually.

  1. Click Edit in the Klarna Order Management metabox.
  2. Click the toggle switch to disable, or enable, order synchronization.
  3. Click OK to save.

Klarna Point of Sale integration


With the Klarna Order Management for WooCommerce plugin you can now add your Klarna Point of Sale orders to WooCommerce to be able to handle them through our plugin. To do this you need to follow the steps bellow:

  1. Go to the order screen by navigating to WooCommerce → Orders and click the Add order button.
  2. Click Edit and scroll down to Payment method. Choose Klarna from the dropdown and enter the Klarna order ID from the Point of Sale into the Transaction ID field.
  3. Click on the Create button.

After this is done, the order should automatically be updated with the customers address information and purchased products.

And you can now start using the Order Management plugin to manage the order directly through WooCommerce.


Anonymize product names sent to Klarna


To modify the order data sent to Klarna, to anonymize the product names, you can add this filter. You can use the Code Snippets plugin, or something similar of your choice.

add_filter(
	'kom_order_capture_args',
	function( $request_args ) {
		foreach ( $request_args['order_lines'] as $index => $order_line ) {
			if ( in_array( $order_line['type'], array( 'physical', 'digital' ) ) ) {
				$request_args['order_lines'][ $index ]['name'] = md5( $order_line['name'] );
			}
		}
		return $request_args;
	}
);

This will result in the product names sent to Klarna will be just a random series of letters and numbers:

The real name of the product is still visible in the WooCommerce order. It is only in Klarna’s system where the name is anonymized/censored.


Troubleshooting / plugin logic


If you run into issues or use other plugins that modifies the order handling logic, this is how the Klarna Order Management plugin works.

  • To be able to capture an order, the Klarna order ID must be available in either of the two order meta fields _wc_klarna_order_id or _transaction_id (_transaction_id is the regular WooCommerce transaction ID field).
  • When the order is captured in Klarnas system, Klarna sends back a Capture ID that is saved in the order in the meta data field _wc_klarna_capture_id.
  • To refund an order in Klarna directly from WooCommerce the Capture ID saved in the _wc_klarna_capture_id meta field must be available.

Known compatibility issues


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.