<!-- canonical: https://docs.costplus.io/api-reference/orders/createRefund -->

> Create a full or partial refund for an order.
# Create a refund

Create a full or partial refund for an order.

## Endpoint

```
POST /orders/{id}/refunds
```

## Authentication

HTTP Basic — use your API key as the username with an empty password.

```bash
curl -u YOUR_API_KEY: https://api.costplus.online/v1/orders/{id}/refunds/
```

## Parameters

| In | Name | Type | Required | Description |
|---|---|---|---|---|
| path | `id` | string | yes | Order identifier |

## Request body

Content-Type: `application/json` (required)

Fields:

- `amount` — integer. Refund amount in minor units
- `description` — string,null. Refund description
- `merchant_order_id` — string. Merchant's refund reference
- `order_lines` — array. Order lines to refund

Example:

```json
{
  "amount": 500,
  "description": "Refund for damaged item",
  "merchant_order_id": "refund-001"
}
```

## Responses

### 200 — The order with the refund applied

### 401 — Invalid or missing API key

### 403 — No authorization for the requested resource

## cURL

```bash
curl -u YOUR_API_KEY: \
  -X POST https://api.costplus.online/v1/orders/4851e31c-4137-4e91-95ef-1df945ee76a2/refunds/ \
  -H 'Content-Type: application/json' \
  -d '{ "amount": 500, "description": "Refund for damaged item" }'
```
