Order Management API (1.0)

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.

Download OpenAPI description
Languages
Servers
https://api.klarna.com/

Orders

Operations

Captures

Operations

Refunds

Operations

Refund an order

Request

Create a refund. Read more on Refunds

Path
order_idstringrequired

Order id

Headers
Klarna-Idempotency-Keystring

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.

Bodyapplication/jsonrequired
descriptionstring[ 0 .. 255 ] characters

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

order_linesArray 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.

referencestring[ 0 .. 255 ] characters

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

refunded_amountinteger(int64)[ 0 .. 200000000 ]required

Refunded amount in minor units.

curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/refunds' \
  -H 'Content-Type: application/json' \
  -H 'Klarna-Idempotency-Key: string' \
  -d '{
    "description": "string",
    "order_lines": [
      {
        "image_url": "https://yourstore.example/product/headphones.png",
        "merchant_data": "Some metadata",
        "name": "string",
        "product_identifiers": {
          "brand": "Intel",
          "category_path": "Electronics Store > Computers & Tablets > Desktops",
          "color": "Denim blue",
          "global_trade_item_number": "735858293167",
          "manufacturer_part_number": "BOXNUC5CPYH",
          "size": "4"
        },
        "product_url": "https://yourstore.example/product/headphones",
        "quantity": 1,
        "quantity_unit": "pcs.",
        "reference": "75001",
        "subscription": {
          "interval": "MONTH",
          "interval_count": 1,
          "name": "string"
        },
        "tax_rate": 0,
        "total_amount": 200000000,
        "total_discount_amount": 0,
        "total_tax_amount": 200000000,
        "type": "physical",
        "unit_price": 200000000
      }
    ],
    "reference": "string",
    "refunded_amount": 200000000
  }'

Responses

Refund created

Headers
Locationany

The URI at which the created refund can be found

Refund-Idany

The id of the created refund

Bodyapplication/json
string
Response
application/json
"string"

Get refund details

Request

Get refund.

Path
order_idstringrequired

Order id

refund_idstringrequired

Refund id

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

Responses

Refund found.

Bodyapplication/json
credit_invoiceboolean

Only relevant for B2B Orders. If the flag is set to true for an order with B2B_invoice as payment method, the customer will receive the refund as a credit invoice.

descriptionstring

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

Example: "The item was returned and the order refunded."
order_linesArray of objects(order_line)

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

referencestring

Internal reference to the refund that is also included in the settlement files. Max length is 255 characters.

refund_idstring

The refund id. Generated when the refund is created.

Example: "b2cb4f2e-2781-4359-80ad-555735ebb8d8"
refunded_amountinteger(int64)

Refunded amount in minor units.

refunded_atstring(date-time)

The time of the refund. ISO 8601.

Example: "2015-12-04T15:17:40Z"
Response
application/json
{ "credit_invoice": true, "description": "The item was returned and the order refunded.", "order_lines": [ {} ], "reference": "string", "refund_id": "b2cb4f2e-2781-4359-80ad-555735ebb8d8", "refunded_amount": 0, "refunded_at": "2015-12-04T15:17:40Z" }