Klarna Docs - Getting started

Getting started

Real-time shipping options in the checkout

Before you get started, make sure you have everything you need:

  • Klarna Checkout integration. Click here to learn more about direct or partner integrations.
  • Fallback. You can optionally provide fallback shipping options when you create a Checkout session. We use those options if the Shipping API integration is not responding or otherwise fails. This way, we ensure the user can always complete their purchase.

Checkout integration

If you have an existing Checkout v3 integration, you should adjust the following for an ideal integration:

  • You can set allow_separate_shipping_address to true if you want to offer separate shipping and billing. The displayed delivery options will be based on the billing address if this flag is false or not specified.
  • You can indicate with the shipping_countries list countries you ship to. It will default to the purchase country only if it's not set.
  • You can define shipping_attributes at the order level or the order line level. These are passed on to the Shipping API and can influence the available shipping options.
  • You can show delivery information after the checkout on the confirmation page.
  • You can send fallback shipping options for every KCO session. These are used if the Integrator fails to provide real-time data.
  • You should not use the shipping_options_update callback from KCO. If you implement it, you must set the shipping fee as an order line in every call.
  • You cannot use our Shipping API flow for digital products (e.g. gift cards which are not shipped physically) as they are currently not supported. If there are no physical items in the cart, we recommend not showing KSA. To do this: make sure that all order_lines have type digital. This will suppress the Shipping Assistant.

If you have an existing Instant Shopping integration, you should adjust the following for an ideal integration:

When creating a button key from the server side:

  • You should set allow_separate_shipping_address to true if you want to offer separate shipping and billing. The displayed delivery options will be based on the billing address if this flag is false or not specified.

The following you can do either while configuring an Instant Shopping display through the JavaScript API from the client side or while creating a button key through the REST API from the server side.

  • You must send fallback shipping options for every Instant Shopping shown. These are used if the Integrator fails to provide real-time data. (JavaScript API | REST API)
  • You can indicate with the property shipping_countries the list of countries to which you ship. It will default to the purchase country only if it's not set. (JavaScript API | REST API)
  • You can define shipping_attributes.
  • When an order is authorized, you will receive a ping to approve or decline the order at the merchant_urls.place_order endpoint. This endpoint you have defined when creating the button key. The request will include the authorized order, including information about the selected_shipping_option, which includes the tms_reference.

To activate the Klarna Shipping Assistant, you must provide us with your shipping credentials in the merchant portal. The shipping credentials consist of an endpoint, an identifier and a key. How you obtain these credentials depends on the type of integration:

  • If you work with one of our partners, like Unifaun or Consignor, you will get the credentials from them.
  • If you implement the Shipping API directly, you should be able to provide us with these credentials.

You can activate Shipping in the merchant portal.

  1. Log in to the merchant portal.
  2. Go to the Logistics app. There you can add your credentials and manage other logistics-related settings.
  3. When activating the Klarna Shipping Assistant for the first time, you will have to accept the terms of use.
  4. You can easily add as many credentials as you want. We will use the active credentials to fetch shipping options via the Shipping API.

You can come back to this app anytime to update your credentials.

Onboarding guides to our partners can be found on our Partnerships page.