Cancels the original order and submits a new one. One of cancelOrderId and cancelOrigClientOrderId must be provided.
Request:
{
"id": "5b",
"op": "replace-order",
"args": {
"symbol": "BTCUSDC",
"side": "BUY",
"price": "61000",
"quantity": "0.01",
"cancelOrderId": 2198729355243696896,
"newClientOrderId": "new-order-001",
"timeInForce": "GTC",
"cancelReplaceMode": "STOP_ON_FAILURE"
}
}| Field | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair |
| side | string | Yes | BUY / SELL |
| price | string | Yes | New price |
| quantity | string | Yes | New quantity |
| cancelOrderId | long | One of the two | orderId of the order to cancel |
| cancelClientOrderId | string | One of the two | Client-defined ID of the order to cancel |
| newClientOrderId | string | No | Client-defined ID of the new order, format [a-zA-Z0-9-_.], max length 100 |
| timeInForce | string | No | GTC/IOC/FOK/POST_ONLY/GTD, defaults to GTC |
| expireTime | long | Required for GTD | Expiration timestamp (milliseconds) |
| selfTradePreventionMode | string | No | Self-trade prevention mode |
| cancelReplaceMode | string | No | Replace mode, defaults to STOP_ON_FAILURE. See the options below |
cancelReplaceMode values:
| Value | Description |
|---|---|
| STOP_ON_FAILURE | If the cancel fails, the new order is not attempted (default) |
| ALLOW_FAILURE | The new order is attempted even if the cancel fails |
| PLACED_THEN_CANCEL | The old order is cancelled only after the new order is placed successfully |
On success, data is the new order information (a single object); on failure, data is an error object {code, msg}.
