> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v2.reeple.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a refund

> Refund a settled order back to the customer

Refunds a successful order, in full or in part, back to the payment instrument it came from.

## Endpoint

```
POST https://api-v4.reeple.ai/charge/order/refund
```

## Authentication

Authenticate with your **secret key** in the `api-key` header.

```
api-key: YOUR_SECRET_KEY
```

## Request body

Plain JSON — this endpoint is **not** encrypted.

| Field       | Type   | Description                                                                     |
| ----------- | ------ | ------------------------------------------------------------------------------- |
| `reference` | String | **Required.** The reference of the order to refund.                             |
| `reason`    | String | **Required.** Why the refund is being issued. Stored against the refund record. |
| `amount`    | Number | Optional. Refund this much instead of the full amount.                          |

```json theme={null}
{
  "reference": "order-2026-0001",
  "reason": "Customer cancelled the order",
  "amount": 200
}
```

<Note>
  Omit `amount` to refund the order in full. Supply it for a partial refund — it cannot exceed
  the amount originally charged.
</Note>

## Request example

```bash theme={null}
curl -X POST https://api-v4.reeple.ai/charge/order/refund \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_SECRET_KEY" \
  -d '{
    "reference": "order-2026-0001",
    "reason": "Customer cancelled the order"
  }'
```

## Response

Returns the standard envelope with the created refund record.

<Note>
  The provider has not published a success response body for this endpoint. Confirm the exact
  shape against your sandbox account before depending on individual fields, and read refunds
  back with [List refunds](/api-reference/refunds/list-refunds).
</Note>

## Rules

* The order must have reached a **successful** final status. A pending order cannot be refunded
  — there is nothing to return yet.
* Refunds go back to the original payment instrument. You cannot redirect one elsewhere.
* Settlement takes time, typically several working days for a card.

<Warning>
  Refunding is not the same as cancelling. If a customer abandons a payment, do nothing — the
  order simply never settles. Only refund money that actually arrived.
</Warning>

<Warning>
  Guard against double refunds on your side. Record that you have issued a refund against a
  reference before you call this endpoint, so a retry after a timeout doesn't send a second one.
</Warning>

## Common errors

| Code  | Message                                          | Cause                                               |
| ----- | ------------------------------------------------ | --------------------------------------------------- |
| `401` | `Invalid SECRET key. Please check and try again` | Wrong key type, or a key from the other environment |
| `13`  | `Order not found at the moment`                  | The reference doesn't match a settled order         |

## Next steps

<CardGroup cols={2}>
  <Card title="List refunds" href="/api-reference/refunds/list-refunds">
    Read back the refunds you've issued.
  </Card>

  <Card title="List chargebacks" href="/api-reference/refunds/list-chargebacks">
    Refunds forced by the customer's bank.
  </Card>
</CardGroup>
