Klarna Order Management API (1.0)

Download OpenAPI specification:Download

The Order Management API is used for handling an order after the customer has completed the purchase. It is used for all actions you need to manage your orders. Examples being: updating, capturing, reading and refunding an order.

Read more on the Order management process.

Authentication

basicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Captures

List all order captures

List all order captures

Request
path Parameters
order_id
required
string

Order id

Responses
200

Captures found.

404

Order not found.

get/ordermanagement/v1/orders/{order_id}/captures
Request samples
curl -i -X GET \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/captures'
Response samples
application/json
[
  • {
    }
]

Capture an order

Create capture. Read more on Capturing an order

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json

Capture request data

captured_amount
required
integer <int64> [ 0 .. 100000000 ]

The captured amount in minor units.

description
string [ 0 .. 255 ] characters

Description of the capture shown to the customer. Maximum 255 characters.

Array of objects (order_line) [ 0 .. 1000 ] items

Order lines for this capture. Maximum 1000 items.

reference
string [ 0 .. 255 ] characters

Internal reference to the capture. This will be included in the settlement files. Max length is 255 characters.

shipping_delay
integer <int64> >= 0

Delay before the order will be shipped. Use for improving the customer experience regarding payments. This field is currently not returned when reading the order. Minimum: 0. Please note: to be able to submit values larger than 0, this has to be enabled in your merchant account. Please contact Klarna for further information.

Array of objects (shipping_info) [ 0 .. 500 ] items

Shipping information for this capture. Maximum 500 items.

Responses
201

Capture created

403

Capture not allowed.

404

Order not found.

post/ordermanagement/v1/orders/{order_id}/captures
Request samples
application/json
{
  • "captured_amount": 100000000,
  • "description": "string",
  • "order_lines": [
    ],
  • "reference": "string",
  • "shipping_delay": 0,
  • "shipping_info": []
}
Response samples
application/json
{
  • "correlation_id": "66782175-ae05-44fc-9eb3-eeceadbad271",
  • "error_code": "CAPTURE_NOT_ALLOWED",
  • "error_messages": [
    ]
}

Get capture details

Retrieve the details of a capture. To learn more, refer to the Retrieving capture details article.

Request
path Parameters
capture_id
required
string

Capture id

order_id
required
string

Order id

Responses
200

Capture found.

404

Order or capture not found.

get/ordermanagement/v1/orders/{order_id}/captures/{capture_id}
Request samples
curl -i -X GET \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/captures/{capture_id}'
Response samples
application/json
{
  • "billing_address": {
    },
  • "capture_id": "4ba29b50-be7b-44f5-a492-113e6a865e22",
  • "captured_amount": 1,
  • "captured_at": "2015-11-19T01:51:17.000Z",
  • "description": "Order has been shipped",
  • "klarna_reference": "K4MADNY-1",
  • "order_lines": [
    ],
  • "reference": "string",
  • "refunded_amount": 0,
  • "shipping_address": {
    },
  • "shipping_info": []
}

Extend payment due date

Extend the customer's payment due date. Read more on Extending customer due dates

Request
path Parameters
capture_id
required
string

Capture id

order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
number_of_days
required
integer <int32>

Number of days to extend the due date.

Responses
204

Due date was extended.

403

Extension of due date is not possible.

404

Order or capture not found.

patch/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/extend-due-date
Request samples
application/json
{
  • "number_of_days": 0
}
Response samples
application/json
{
  • "correlation_id": "string",
  • "error_code": "string",
  • "error_messages": [
    ]
}

List options for extension of payment due date

Get merchant fees for extension of due date due date

Request
path Parameters
capture_id
required
string

Capture id

order_id
required
string

Order id

Responses
200

Available options found for capture.

404

Order or capture not found.

get/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/extend-due-date-options
Request samples
curl -i -X GET \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/extend-due-date-options'
Response samples
application/json
{
  • "currency": "usd",
  • "options": [
    ]
}

Add shipping information

Add shipping info to a capture. Read more on Adding shipping info

Request
path Parameters
capture_id
required
string

Capture id

order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
required
Array of objects (shipping_info) [ 1 .. 500 ] items

New shipping info. Maximum: 500 items.

Responses
204

Shipping information was appended.

403

Order has no captures.

404

Order or capture not found.

post/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/shipping-info
Request samples
application/json
{}
Response samples
application/json
{
  • "correlation_id": "66782175-ae05-44fc-9eb3-eeceadbad271",
  • "error_code": "NOT_ALLOWED",
  • "error_messages": [
    ]
}

Send customer communication

Trigger resend of customer communication. Read more on Resending customer communication

Request
path Parameters
capture_id
required
string

Capture id

order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Responses
204

Send out was triggered

403

Order has no captures.

404

Order or capture not found.

post/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/trigger-send-out
Request samples
curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/trigger-send-out' \
  -H 'Klarna-Idempotency-Key: string'
Response samples
application/json
{
  • "correlation_id": "66782175-ae05-44fc-9eb3-eeceadbad271",
  • "error_code": "NOT_ALLOWED",
  • "error_messages": [
    ]
}

Orders

Get order details

An order that has the given order id. Read more on Retrieving order details

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Integrator
string
Responses
200

Order found

404

Order not found

get/ordermanagement/v1/orders/{order_id}
Request samples
curl -i -X GET \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}' \
  -H 'Klarna-Integrator: string'

Acknowledge a Klarna checkout order

Acknowledge order. Read more on Acknowledging orders

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Responses
204

Order was acknowledged.

403

Update not allowed.

404

Order not found.

post/ordermanagement/v1/orders/{order_id}/acknowledge
Request samples
curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/acknowledge' \
  -H 'Klarna-Idempotency-Key: string'

Update the order amount and order lines

Set new order amount and order lines. Read more on Updating orders

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
description
string [ 0 .. 255 ] characters

Description of the change.

order_amount
required
integer <int64> [ 0 .. 100000000 ]

The new total order amount. Minor units.

Array of objects (order_line) [ 0 .. 1000 ] items

New set of order lines for the order.

Responses
204

Authorization was updated.

403

Update authorization not allowed. Decision is based on order state and outcome of risk assessment.

patch/ordermanagement/v1/orders/{order_id}/authorization
Request samples
application/json
{
  • "description": "Added charger",
  • "order_amount": 100000000,
  • "order_lines": [
    ]
}

Cancel an order

Cancel order. Read more on Cancelling an order

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Responses
204

Order was cancelled.

403

Cancel not allowed (e.g. order has captures or is closed)

post/ordermanagement/v1/orders/{order_id}/cancel
Request samples
curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/cancel' \
  -H 'Klarna-Idempotency-Key: string'

Update customer addresses

Update shipping address. Read more on Updating customer addresses

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
object (address)
object (address)
Responses
204

Order consumer details were updated.

403

Update customer details not allowed. Decision is based on order state and outcome of risk assessment. Billing address cannot be updated for Klarna User Account orders.

patch/ordermanagement/v1/orders/{order_id}/customer-details
Request samples
application/json
{
  • "billing_address": {
    },
  • "shipping_address": {
    }
}

Extend the authorization time

Extend authorization time. Read more on Extending order authorization time

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Responses
204

Authorization time was extended.

403

Extension of authorization time not allowed. The order being expired or cancelled are among the possible causes.

post/ordermanagement/v1/orders/{order_id}/extend-authorization-time
Request samples
curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/extend-authorization-time' \
  -H 'Klarna-Idempotency-Key: string'

Update merchant references

Update merchant references. Read more on Updating merchant references

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
merchant_reference1
string [ 0 .. 255 ] characters

New merchant reference 1. Old reference will be overwritten if this field is present.

merchant_reference2
string [ 0 .. 255 ] characters

New merchant reference 2. Old reference will be overwritten if this field is present.

Responses
204

Order merchant references were updated.

403

Can not update a cancelled order.

patch/ordermanagement/v1/orders/{order_id}/merchant-references
Request samples
application/json
{
  • "merchant_reference1": "string",
  • "merchant_reference2": "string"
}

Release an authorization

Release remaining authorization. Read more on Releasing remaining authorization

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Responses
204

Remaining authorization was released.

403

Can not release when order is cancelled or has no captures.

post/ordermanagement/v1/orders/{order_id}/release-remaining-authorization
Request samples
curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/release-remaining-authorization' \
  -H 'Klarna-Idempotency-Key: string'

Add shipping information

Add shipping info to an order. Read more on Adding shipping info

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
required
Array of objects (shipping_info) [ 1 .. 500 ] items

New shipping info. Maximum: 500 items.

Responses
204

Shipping information was appended.

404

Order not found.

post/ordermanagement/v1/orders/{order_id}/shipping-info
Request samples
application/json
{}

Refunds

Refund an order

Create a refund. Read more on Refunds

Request
path Parameters
order_id
required
string

Order id

header Parameters
Klarna-Idempotency-Key
string

This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.

Request Body schema: application/json
description
string [ 0 .. 255 ] characters

Description of the refund shown to the customer. Max length is 255 characters.

Array of objects (order_line) [ 0 .. 1000 ] items

Order lines for the refund shown to the customer. Optional but increases the customer experience. Maximum 1000 order lines.

reference
string [ 0 .. 255 ] characters

Internal reference to the refund. This will be included in the settlement files. Max length is 255 characters.

refunded_amount
required
integer <int64> [ 0 .. 100000000 ]

Refunded amount in minor units.

Responses
201

Refund created

403

Refund not allowed

404

Order not found

post/ordermanagement/v1/orders/{order_id}/refunds
Request samples
application/json
{
  • "description": "string",
  • "order_lines": [
    ],
  • "reference": "string",
  • "refunded_amount": 100000000
}

Get refund details

Get refund.

Request
path Parameters
order_id
required
string

Order id

refund_id
required
string

Refund id

Responses
200

Refund found.

404

Order or refund not found.

get/ordermanagement/v1/orders/{order_id}/refunds/{refund_id}
Request samples
curl -i -X GET \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/refunds/{refund_id}'