Skip to main content

Cancel and Replace Order

Cancel an existing order and immediately place a new order with updated parameters in a single atomic operation.

HTTP Request

POST /api/v1/spot/trade/cancel-replace-order

Request Parameters

ParameterTypeRequiredDescription
symbolstringYesTrading pair symbol (e.g., BTCUSDT)
orderIdstringYesOrder ID to cancel and replace
pricestringYesNew order price
sizestringYesNew order size

Request Example

curl -X POST "https://open-api.bydoxe.com/api/v1/spot/trade/cancel-replace-order" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"orderId": "123456789",
"price": "90500.00",
"size": "0.002"
}'

Response Parameters

ParameterTypeDescription
codestringResponse code
msgstringResponse message
requestTimenumberRequest timestamp in milliseconds
dataobjectCancel-replace result data
> orderIdstringNew order ID
> successstringOperation status
> msgstringAdditional message (if any)

Response Example

Success Response

{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": {
"orderId": "123456789",
"success": "success",
"msg": null
}
}

Error Codes

CodeMessage
40001Parameter cannot be empty
40002Unauthorized
40002User not found
40034Currency pair does not exist
43024Order price error
43025Order quantity error
43116Order does not exist
43116Order does not match the symbol
43117Order cannot be cancelled
50000Coin information not found
50000System error