Amend the price or quantity of an existing open order without cancelling it. The order ID stays the same after a successful replace. Two push messages follow on the Orders channel: first action: "AMEND_PENDING" when ConneX submits the change to the exchange, then action: "AMEND_COMPLETED" (or "AMEND_FAILED") once the exchange confirms.
Tip:
You can create order by websocket after login.
This action runs over the User Data WebSocket connection at wwss://wss.connex.trade/v1/private. The server rejects everything until you send a login message, and drops the connection after 30 seconds of inactivity — see Overview for the login payload, signature and heartbeat.
Rate Limit
The limits below apply to this operation. Binance perpetual, Binance spot and margin combined, and OKX across all business lines are counted separately.
main portfolio:
Binance (all business lines)
- Rate Limit: 300 requests per 60 seconds.
OKX (all business lines)
- Rate Limit: 300 requests per 60 seconds.
sub portfolio:
Binance perpetual
- Rate Limit: 20 requests per 10 seconds.
Binance spot and margin
- Rate Limit: 20 requests per 10 seconds.
OKX (all business lines)
- Rate Limit: 20 requests per 10 seconds.
Request
Send a replace_order action with the order ID and the new price or quantity you want. You only need to include the fields you want to change — any field you omit keeps its current value.
{
"id": "XXX",
"action": "replace_order",
"args":
{
"orderId": "XXXX",
"replaceQty": "1000",
"replacePrice": "60000"
}
}
| Field name | Type | Necessary | Remarks |
|---|---|---|---|
| id | String | N | client request id |
| action | String | Y | Must be replace_order. |
| args | Object | Y | request params |
| > orderId | String | Y | ID of the order to amend. The order must currently be in OPENor PARTIALLY_FILLED state. |
| > replaceQty | String | N | New total quantity for the order. If omitted, the current quantity is kept. |
| > replacePrice | String | N | New price for the order. If omitted, the current price is kept. |
| > syncMode | String | N | API synchronous validation or asynchronous validation(required "true" or "false"); default "false" |
At least one of
replaceQtyorreplacePricemust be provided.
Response
The response is sent immediately after ConneX accepts the replace request. It does not mean the exchange has applied the change yet.
Success example:
{
"id": "XXXX",
"event": "replace_order",
"code": "200000",
"msg": "",
"data": {
"orderId": "XXXXX",
"orderState": "XXXXX"
}
}
Fail example:
{
"id":"***",
"event": "error",
"code": "60009",
"msg": "ReplaceOrder failed."
}
code: 200000means ConneX has accepted the replace request and submitted it to the exchange. Monitor theOrderspush channel foraction: "AMEND_COMPLETED"to confirm the new price or quantity is in effect. If the exchange rejects the change, you will receiveaction: "AMEND_FAILED"instead.
| Field name | Type | Remarks |
|---|---|---|
| id | String | client request id |
| event | String | replace_order on success, error on failure. |
| code | String | 200000 = replace request accepted. Any other value indicates an error — check msg for the reason. |
| msg | String | "Success" on success, or an error message explaining why the replace was rejected. |
| data | Object | Present on success only. |
| > orderId | String | The order ID. Unchanged from the original order — replace does not create a new order ID. |
| > orderState | String | Order state at the time of this response (typically OPEN). |
