# order_not_refundable

> The order can't be refunded

- Status: 400 Bad Request
- Returned by: /api/public
- Operations: [refundOrder](https://developers.rivr.io/reference/api-public/refundOrder.md)
- Retry (`retryWhen`): `never`
- Did anything happen? (`outcome`): `unknown` (Unknown)
- Cancelling and refunding in /api/public
- Page in the portal: https://developers.rivr.io/errors/order_not_refundable
- Try it: `GET https://developers.rivr.io/errors/simulate/order_not_refundable` answers with the code's exact wire form; `?succeedAfter=N&attempt=K` gives a 200 once `attempt` passes `N`

## What it means

The order can't be refunded, and this request refunded nothing. The order may already be refunded (`status` Refunded) or have a refund on its way (`status` Completed until the payment provider confirms it). Otherwise it is cancelled, or its payment method can't be refunded through the API, for example a Medical Finance order that Rivr hasn't opened for refunds, a bank payment reference or a direct payment. `message` gives the status, not the reason.

## What your system does

Fetch the order with `GET /api/public/orders/{orderId}` and show what applies. Don't refund it any other way until you know whether a refund has already been made or is on its way.

## Is it worth retrying?

No, not without changing the call.

`retryWhen`: `never`. Don't send it again. The answer is final for this request: read the current state, the order for example, and act on that.

## Did anything happen?

`outcome`: `unknown`. **Unknown.** The answer doesn't say whether what you asked for has happened, through this call or an earlier one. Read the state first.

The request only read the order. An earlier refund may still have been made already, or be on its way with the payment provider, which is exactly the case after a lost `204`. A refund on its way doesn't show on the order until the payment provider has confirmed it.

Read the state (`resolveWith`):

- `refundOrder` → [`GET /api/public/orders/{orderId}`](https://developers.rivr.io/reference/api-public/getOrder.md): `status` 8 (Refunded): already refunded. 32 (Cancelled): nothing refunded. 4 (Completed): either a refund on its way with the payment provider (it becomes Refunded once confirmed; follow the order or the callback) or a payment method that isn't refunded through the API. `paymentMethod` doesn't tell the two apart.

## Example: /api/public

```http
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
  "propertyName": "Status",
  "message": "The order is in status Cancelled and can therefore not be refunded",
  "errorCode": "order_not_refundable",
  "code": "order_not_refundable",
  "type": "https://developers.rivr.io/errors/order_not_refundable"
}
```

The `title`, `detail`, `message` and `error_description` texts are exactly as the API writes them today.
