# order_changed

> The order changed meanwhile

- Status: 409 Conflict
- Returned by: /api/public
- Operations: [cancelOrder](https://developers.rivr.io/reference/api-public/cancelOrder.md), [refundOrder](https://developers.rivr.io/reference/api-public/refundOrder.md)
- Retry (`retryWhen`): `same_request`
- Did anything happen? (`outcome`): `none` (It did not happen)
- Cancelling and refunding in /api/public
- Page in the portal: https://developers.rivr.io/errors/order_changed
- Try it: `GET https://developers.rivr.io/errors/simulate/order_changed` answers with the code's exact wire form; `?succeedAfter=N&attempt=K` gives a 200 once `attempt` passes `N`

## What it means

The order changed while the request was handling it, for example the patient paid, a payment started or another request cancelled it. This request therefore changed nothing, and the order was not cancelled.

## What your system does

Send the same call again. The answer then says what applies to the order now. On `POST /api/public/orders/{orderId}/refund` that retry refunds a payment that arrived meanwhile.

## Is it worth retrying?

Yes. The same call can succeed in a while.

`retryWhen`: `same_request`. Send the very same request again, unchanged: the same `Idempotency-Key` and the same order id. Wait `Retry-After` seconds when the answer has the header, otherwise a short while that grows with each attempt.

## Did anything happen?

`outcome`: `none`. **It did not happen.** This call did not do what you asked for and changed nothing else that you can see or that concerns money. Where the code has an `outcomeNote`, it takes precedence.

The request wrote nothing, but the order was changed by someone else meanwhile: the patient may have paid, a payment attempt or disbursement may have started, or another request or Rivr's portal may have cancelled the order. On refund, sending the call again refunds a payment that arrived meanwhile.

## Example: /api/public

```http
HTTP/1.1 409 Conflict
Content-Type: application/json

{
  "propertyName": "Status",
  "message": "The order changed while it was being cancelled and was not cancelled. Retry the request to get the order's current state.",
  "errorCode": "order_changed",
  "code": "order_changed",
  "type": "https://developers.rivr.io/errors/order_changed"
}
```

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