# Cancel Order by Order ID


:::warning[]
You must be authenticated and [subscribed](https://docs.onetrading.com/websocket/subscribe.md) to the `TRADING` channel in order to send trading messages.
:::

Submits a request to cancel an open order by providing a valid `order_id`.

## Cancel Order Request

```json
{
    "type": "CANCEL_ORDER",
    "order_id": "cf39efef-2924-4713-9fb0-e06bd4acd13d"
 }
```

<DataSchema id="408015" />

## Cancel Order by Order ID Response

### Error

#### Order not found

```json
{
    "error": "ORDER_NOT_FOUND",
    "order_id": "cf39efef-2924-4713-9fb0-e06bd4acd13d"
}
```

#### Invalid Order ID

```json
{
    "error": "ORDER_ID_ERROR",
    "payload": {
        "type": "CANCEL_ORDER",
        "order_id": "not valid"
    }
}
```

### Success

If a cancel order by order ID request is valid, you will receive an [Order Closed](https://docs.onetrading.com/348529m0.md) notification.