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

Get order details

Request

Path
order_idstringrequired

Order id

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

Responses

Order found

Bodyapplication/json
billing_addressobject(address)

Shipping address for the capture.

captured_amountinteger(int64)

The total amount of all captures. In minor units.

Example: 0
capturesArray of objects(Capture)

List of captures for this order.

created_atstring(date-time)

The time for the purchase. Formatted according to ISO 8601.

Example: "2015-11-29T10:25:40Z"
customerobject(customer)

Information about the customer placing the order.

expires_atstring(date-time)

Order expiration time. The order can only be captured until this time. Formatted according to ISO 8601.

Example: "2015-12-04T10:26:06Z"
fraud_statusstring

Fraud status for the order. Either ACCEPTED, PENDING or REJECTED.

Example: "ACCEPTED"
initial_payment_methodobject(InitialPaymentMethodDto)

Initial payment method for this order

klarna_referencestring

A Kustom generated reference that is shorter than the Order Id and is used as a customer friendly reference. It is most often used as a reference when Kustom is communicating with the customer with regard to payment statuses.

Example: "K4MADNY"
localestring

The customers locale. Specified according to RFC 1766.

Example: "en-US"
merchant_datastring

Text field for storing data about the order. Set at order creation.

Example: "Order metadata"
merchant_reference1string

The order number that the merchant should assign to the order. This is how a customer would reference the purchase they made. If supplied, it is labeled as the Order Number within post purchase communications.

Example: "10001"
merchant_reference2string

Can be used to store your internal reference to the order. This is generally an internal reference number that merchants use as alternate identifier that matches their internal ERP or Order Management system.

Example: "501"
order_amountinteger(int64)

The order amount in minor units. That is the smallest currency unit available such as cent or penny.

order_idstring

The unique order ID. Cannot be longer than 255 characters.

Example: "f3392f8b-6116-4073-ab96-e330819e2c07"
order_linesArray of objects(order_line)

An array of order_line objects. Each line represents one item in the cart.

original_order_amountinteger(int64)

The original order amount. In minor units.

purchase_countrystring

The purchase country. Formatted according to ISO 3166-1 alpha-2.

Example: "US"
purchase_currencystring

The currency for this order. Specified in ISO 4217 format.

Example: "USD"
refunded_amountinteger(int64)

The total amount of refunded for this order. In minor units.

Example: 0
refundsArray of objects(Refund)

List of refunds for this order.

remaining_authorized_amountinteger(int64)

The remaining authorized amount for this order. To increase the remaining_authorized_amount the order_amount needs to be increased.

Example: 0
selected_shipping_optionobject(SelectedShippingOptionDto)

The shipping option selected by the user.

shipping_addressobject(address)

Shipping address for the capture.

shipping_infoArray of objects(shipping_info)

Shipping information for this order.

statusstring

The order status.

Enum"AUTHORIZED""PART_CAPTURED""CAPTURED""CANCELLED""EXPIRED""CLOSED"
Example: "AUTHORIZED"
Response
application/json
{ "billing_address": { "attention": "John Smith", "city": "New York", "country": "US", "email": "test.sam@test.com", "family_name": "Andersson", "given_name": "Adam", "organization_name": "Kustom", "phone": "1-555-555-5555", "postal_code": "10024-3941", "region": "US-NY", "street_address": "509 Amsterdam Ave", "street_address2": "Floor 22 / Flat 2", "title": "Mr." }, "captured_amount": 0, "captures": [ {} ], "created_at": "2015-11-29T10:25:40Z", "customer": { "date_of_birth": "1981-09-06", "national_identification_number": "string" }, "expires_at": "2015-12-04T10:26:06Z", "fraud_status": "ACCEPTED", "initial_payment_method": { "description": "Slice it (Fixed Payments)", "number_of_installments": 3, "type": "FIXED_AMOUNT" }, "klarna_reference": "K4MADNY", "locale": "en-US", "merchant_data": "Order metadata", "merchant_reference1": "10001", "merchant_reference2": "501", "order_amount": 0, "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07", "order_lines": [ {} ], "original_order_amount": 0, "purchase_country": "US", "purchase_currency": "USD", "refunded_amount": 0, "refunds": [ {} ], "remaining_authorized_amount": 0, "selected_shipping_option": { "carrier": "string", "carrier_product": {}, "class": "string", "id": "string", "location": {}, "method": "string", "name": "string", "price": 0, "selected_addons": [], "tax_amount": 0, "tax_rate": 0, "timeslot": {}, "tms_reference": "string", "type": "string" }, "shipping_address": { "attention": "John Smith", "city": "New York", "country": "US", "email": "test.sam@test.com", "family_name": "Andersson", "given_name": "Adam", "organization_name": "Kustom", "phone": "1-555-555-5555", "postal_code": "10024-3941", "region": "US-NY", "street_address": "509 Amsterdam Ave", "street_address2": "Floor 22 / Flat 2", "title": "Mr." }, "shipping_info": [ {} ], "status": "AUTHORIZED" }

Acknowledge a Kustom checkout order

Request

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.

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

Responses

Order was acknowledged.

Response
No content

Update the order amount and order lines

Request

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

Example: "Added charger"
order_amountinteger(int64)[ 0 .. 200000000 ]required

The new total order amount. Minor units.

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

New set of order lines for the order.

curl -i -X PATCH \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/authorization' \
  -H 'Content-Type: application/json' \
  -H 'Klarna-Idempotency-Key: string' \
  -d '{
    "description": "Added charger",
    "order_amount": 200000000,
    "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
      }
    ]
  }'

Responses

Authorization was updated.

Bodyapplication/json
string
Response
application/json
"string"

Update customer addresses

Request

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
shipping_addressobject(address)

Shipping address for the capture.

curl -i -X PATCH \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/customer-details' \
  -H 'Content-Type: application/json' \
  -H 'Klarna-Idempotency-Key: string' \
  -d '{
    "shipping_address": {
      "attention": "John Smith",
      "city": "New York",
      "country": "US",
      "email": "test.sam@test.com",
      "family_name": "Andersson",
      "given_name": "Adam",
      "organization_name": "Kustom",
      "phone": "1-555-555-5555",
      "postal_code": "10024-3941",
      "region": "US-NY",
      "street_address": "509 Amsterdam Ave",
      "street_address2": "Floor 22 / Flat 2",
      "title": "Mr."
    }
  }'

Responses

Order consumer details were updated.

Bodyapplication/json
string
Response
application/json
"string"

Extend the authorization time

Request

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.

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

Responses

Authorization time was extended.

Response
No content

Update merchant references

Request

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
merchant_reference1string[ 0 .. 255 ] characters

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

merchant_reference2string[ 0 .. 255 ] characters

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

curl -i -X PATCH \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/merchant-references' \
  -H 'Content-Type: application/json' \
  -H 'Klarna-Idempotency-Key: string' \
  -d '{
    "merchant_reference1": "string",
    "merchant_reference2": "string"
  }'

Responses

Order merchant references were updated.

Response
No content

Release an authorization

Request

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.

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

Responses

Remaining authorization was released.

Bodyapplication/json
string
Response
application/json
"string"

Add shipping information

Request

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
shipping_infoArray of objects(shipping_info)[ 1 .. 500 ] itemsrequired

New shipping info. Maximum: 500 items.

curl -i -X POST \
  'https://api.klarna.com/ordermanagement/v1/orders/{order_id}/shipping-info' \
  -H 'Content-Type: application/json' \
  -H 'Klarna-Idempotency-Key: string' \
  -d '{
    "shipping_info": [
      {
        "return_shipping_company": "dhl-express",
        "return_tracking_number": "93456415674545679888",
        "return_tracking_uri": "http://shipping.example/findmypackage?93456415674545679888",
        "shipping_company": "dhl-express",
        "shipping_method": "Home",
        "tracking_number": "63456415674545679874",
        "tracking_uri": "http://shipping.example/findmypackage?63456415674545679874"
      }
    ]
  }'

Responses

Shipping information was appended.

Response
No content

Cancel an order

Request

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.

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

Responses

Order was cancelled.

Response
No content

Captures

Operations

Refunds

Operations