Skip to main content

Modify Order (TRADE)

API Description

Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

HTTP Request

PUT /dapi/v1/order

Request Weight

1

Request Parameters

NameTypeMandatoryDescription
orderIdLONGNO
origClientOrderIdSTRINGNO
symbolSTRINGYES
sideENUMYESSELL, BUY
quantityDECIMALNOOrder quantity, cannot be sent with closePosition=true.
After CM migration, this parameter becomes mandatory (must be sent together with price).
priceDECIMALNOAfter CM migration, this parameter becomes mandatory (must be sent together with quantity).
priceMatchENUMNOonly avaliable for LIMIT/STOP/TAKE_PROFIT order; can be set to OPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20: /QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20; Can't be passed together with price
recvWindowLONGNO
timestampLONGYES
  • Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.
  • Either quantity or price must be sent. (After CM migration, both quantity and price are required.)
  • When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
  • However the order will be cancelled by the amendment in the following situations:
    • when the order is in partially filled status and the new quantity <= executedQty
    • When the order is GTX and the new price will cause it to be executed immediately
  • One order can only be modfied for less than 10000 times

Response Example

{
"orderId": 20072994037,
"symbol": "BTCUSD_PERP",
"pair": "BTCUSD",
"status": "NEW",
"clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW",
"price": "30005",
"avgPrice": "0.0", // Will be removed after CM migration
"origQty": "1",
"executedQty": "0",
"cumQty": "0",
"cumBase": "0", // Will be removed after CM migration
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"closePosition": false,
"side": "BUY",
"positionSide": "LONG",
"stopPrice": "0",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"priceMatch": "NONE", //price match mode
"selfTradePreventionMode": "NONE", //self trading preventation mode
"updateTime": 1629182711600
}