Skip to main content

Cancel an Existing Order and Send a New Order

Rate limit: 5 requests/second/UID

Description

Cancel an Existing Order and Send a New Order

HTTP Request

  • POST /api/v2/spot/trade/cancel-replace-order
Request Example
curl -X POST "https://api.bitget.com/api/v2/spot/trade/cancel-replace-order" \
-H "ACCESS-KEY:*******" \
-H "ACCESS-SIGN:*******" \
-H "ACCESS-PASSPHRASE:*****" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:en-US" \
-H "Content-Type: application/json" \
-d '{
"orderId":"xxxxxxxxxxxxxxx",
"clientOid":"",
"symbol": "BTCUSDT",
"price":"3.24",
"size":"4"
}'

Request Parameter

ParameterTypeRequiredDescription
symbolStringYesTrading pair name, e.g. BTCUSDT
All symbols can be returned by Get Symbol Info interface
priceStringYesLimit price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
sizeStringYesAmount,it represents the number of base coins.
clientOidStringNoClient Order ID
Either orderId or clientOid is required
orderIdStringNoOrder ID
Either orderId or clientOid is required
newClientOidStringNoNew customed order ID. The idempotency time is 6 hours, only valid when orders are unfilled.
presetTakeProfitPriceStringNoTake profit price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
executeTakeProfitPriceStringNoTake profit execute price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
presetStopLossPriceStringNoStop loss price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
executeStopLossPriceStringNoStop loss execute price
The decimal places of price and the price step can be returned by the Get Symbol Info interface
Response Example
{
"code": "00000",
"msg": "success",
"requestTime": 1725345009763,
"data": {
"orderId": "xxxxxxxxxxxxxxx",
"clientOid": null,
"success": "success",
"msg": null
}
}

Response Parameter

ParameterTypeDescription
orderIdStringOrder ID
clientOidStringCLient Order ID
successStringoperate success
success: success
failure: failure
msgStringFailure reason

How was your Reading Experience with us?