younifyd
Menu

Refund an order

Refund an order

POST/ordermanagement/v1/orders/{order_id}/refunds

Use it in a workflow

  1. Add a step and choose the Klarna connector.
  2. Pick the Refund an order action (under Order Management).
  3. Fill in the fields below, then reference the result from later steps as {{refundAnOrder.response.data}}.

Request

Path parameters

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.

Request body

Enter the body as JSON in the step's Body field.

descriptionstring

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

order_linesarray<object>

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

image_urlstring

URL to an image that can be embedded in communications between Klarna and the customer.

merchant_datastring

Data about the order line.

namestringrequired

Descriptive item name.

product_identifiersobject6 fields

product_identifiers

product_urlstring

URL to the product that can be used in communications between Klarna and the customer.

quantityinteger (int64)required

Item quantity.

quantity_unitstring

Unit used to describe the quantity.

referencestring

Article number, SKU, or similar identifier on the product variant level.

subscriptionobject3 fields

Subscription information, such as the cadence and product name of the subscription that an order line item belongs to.

tax_rateinteger (int32)

The tax rate in percent with two implicit decimals.

total_amountinteger (int64)required

Total amount including tax and discounts (`quantity * unit_price - total_discount_amount`).

total_discount_amountinteger (int64)

The discount amount in minor units. Includes tax. Example: 1200 = $12. Max value: 200000000

total_tax_amountinteger (int64)

The total tax amount in minor units.

typestring

Order line type.

One ofphysicaldiscountshipping_feesales_taxstore_creditgift_carddigitalsurchargereturn_fee

unit_priceinteger (int64)required

Unit price including tax without applying discounts in minor units.

referencestring

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

refunded_amountinteger (int64)required

Refunded amount in minor units.

json
{
  "refunded_amount": 0,
  "description": "string",
  "order_lines": [
    {
      "name": "string",
      "quantity": 1,
      "total_amount": 0,
      "unit_price": 0,
      "image_url": "https://yourstore.example/product/headphones.png",
      "merchant_data": "Some metadata",
      "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_unit": "pcs.",
      "reference": "75001",
      "subscription": {
        "interval": "MONTH",
        "interval_count": 0,
        "name": "string"
      },
      "tax_rate": 0
    }
  ],
  "reference": "string"
}

Response

Returns 201 with a string. Read it in later steps with {{refundAnOrder.response.data.<field>}}.

Need more? See the Klarna guide for connection setup and behaviour shared by every action.

Refund an order — Klarna — Documentation