---
id: refund-order-with-fee
title: Refund an order with a fee
hide_title: true
description: "Management API - Use case - Refund order with a fee"
---

import Ingress from '../../../../src/components/ingress/ingress.react';

<Ingress title="Refund an order with a fee">
Use this request when you want to charge the customer for a fee when making a refund
</Ingress>

## Use case

Part of, or the entire order has been returned by the customer and you want the money to be refunded.

When the order is refunded, the...

- state of the order will be `Activated` or `Part activated` in Walley's system if part of the order is refunded.
- the funds excluding the fee will automatically be paid out to the customer
- the returned article(s) and the fee will be a part of the reconciliation report
- if no payment has been made the customer gets a new invoice with the fee amount

One or more fees can be added, but the total fee amount is not allowed to be greater than the value of the article(s) being returned.

## Endpoints used

[Refund order](/docs/manage/orders/refund)

## Example

The following request will refund the order with id `abcdef-12345-1234-5555-6666`

```http
POST /manage/orders/abcdef-12345-1234-5555-6666/refund HTTP/1.1
Host: api.uat.walleydev.com // Test environment. Production uses a different hostname.
Authorization: Bearer {{accessToken}}
Walley-Idempotency: 03304b06-cb33-4f78-bcea-86cb4b202ba0
Content-Type: application/json

{
  "amount": 285.0,
  "description": "Refund description",
  "actionReference": "test-refundref-123",
  "items": [
    {
      "id": "10001",
      "description": "Shoes",
      "unitPrice": 300,
      "quantity": 1,
      "vat": 25,
      "type": "purchase"
    },
    {
      "id": "fee",
      "description": "Return fee",
      "unitPrice": -15,
      "quantity": 1,
      "vat": 25,
      "type": "fee"
    }
  ]
}
```
