# Cancel Replace

The CANCELREPLACE command is effectively a CANCEL order + PLACE order command combination and accepts similar parameters. The caveat is that the PLACE command will only proceed if and only if the order exists and was successfully canceled.

The `order_id` field is required to identify the order in question to cancel. If it is not found or not linked to an active order, an error message will be returned.

### Example Payload

The following alert message will cancel the order with ID "abc123" and execute the remaining fields as a PLACE order command:

```
key=your-secret-key; 
command=cancelreplace; 
account=sim101; 
instrument=ES 06-26;
action=buy; 
qty=1; 
order_type=market; 
tif=day; 
order_id=abc123;
```
