Klarna Docs - Pre-delivery

Pre-delivery

Read on how to setup pre-delivery with Klarna's Order Management API
  • You have already obtained your API credentials.
  • A purchase has been made.
  • You have retrieved and acknowledge an order as described on the Confirm purchase page.
  • The order has not been captured.

Update the total order amount of an order.

Each update depends on approval by Klarna. Expect that the update may be rejected in some cases.

The customer has contacted you to change or remove a product from the order and you need to update the total order amount.

Increasing the order amount is not allowed for all payment methods, see below for details on when it is allowed. Any update to order amount will override and replace the original order amount as well as any possible order lines you might have sent with the order.

Important note: Sometimes the increase might be rejected as we are not allowed to grant a customer an extended order amount. In these cases the customer should be asked to place a new order in your shop for the new items. Be aware that increasing the order amount will trigger a second risk assessment on the customer, sometimes even a credit lookup.

Supported Payment MethodDescriptionAvailable Markets
Invoice / StatementINVOICEAll (excl. CH)
Invoice / Statement (B2B)INVOICE_BUSINESSAll (excl. CH)
Slice it (Flexible)ACCOUNTAll (excl. CH)
Slice it (Fixed amount)FIXED_AMOUNTSE, NO, FIN, DK, AT & DE
Direct DebitDIRECT_DEBITAll (excl. CH)
Slice it (Deferred interest)DEFERRED_INTERESTUS

Please note that you will override and replace the original order amount as well as any possible order lines you might have sent with the order.

Flow diagram depicting how the total order amount gets updated

Fig.1 Update the total order amount flow

The updated amount can optionally be accompanied by a descriptive text and new order lines. Supplied order lines will replace the existing order lines. If no order lines are supplied in the call, the existing order lines will be deleted.

We suggest that you always send updated order lines to increase the customer experience. These can later be used to visualize what the customer bought when Klarna sends settlement details to the customer.

The updated order_amount must not be negative, nor less than current captured_amount.

Currency is inferred from the original order.

JSON
PATCH /ordermanagement/v1/orders/{order_id}/authorization
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Content-Type: application/json

{
  "order_amount": 6000,
  "description": "",
  "order_lines": [
    {
      "type": "physical",

Klarna will respond with 204. The server has fulfilled the request or an error message

HTTP
HTTP/1.1 204 No Content

For a cancellation to be successful, there must be no captures on the order. The authorized amount will be released and no further updates to the order will be allowed. Please note that a cancelled order cannot be reopened.

The customer has decided not to proceed with the purchase and wants to cancel the order before shipping the product.

HTTP
POST /ordermanagement/v1/orders/{order_id}/cancel
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Content-Type: application/json

Klarna will respond with 204. The server has fulfilled the request or an error message

HTTP
HTTP/1.1 204 No Content

Get the current state of an order.

When you want to view the entire order information and its captures. This will give you information of the current content and state of the order.

HTTP
GET /ordermanagement/v1/orders/{order_id}
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Content-Type: application/json

Klarna will respond with 200. The order is returned or an error message

HTTP
HTTP/1.1 200 OK
Content-Type: application/json

{}

Update billing and/or shipping address for an order. Please note that doing so the order will be subject to customer credit check.

The customer needs to change his/her billing and/or shipping address.

Fields can be updated independently. To clear a field, set its value to “” (empty string). Mandatory fields can not be cleared.

JSON
PATCH /ordermanagement/v1/orders/{order_id}/customer-details
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Content-Type: application/json

{
  "shipping_address": {
    "street_address": "123 Fake St",
    "postal_code": "12345",
    "city": "New York",
    "region": "NY",

Klarna will respond with 204. The server has fulfilled the request or an error message

HTTP
HTTP/1.1 204 No Content

Update your merchant specific reference information (your internal order ID). This call will update your reference number on an order.

You want to use your own order ID on the Klarna order.

Update one or both merchant references. To clear a reference, set its value to “” (empty string).

JSON
PATCH /ordermanagement/v1/orders/{order_id}/merchant-references
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Content-Type: application/json

{
    "merchant_reference1": "15632423",
    "merchant_reference2": "special order"
}

Klarna will respond with 204. The server has fulfilled the request or an error message

HTTP
HTTP/1.1 204 No Content

You have now implemented all the features you need to handle your pre-delivery process, you can now continue to implement the delivery calls.