Skip to main content

Amend Order

Amend Order

Modify the price, quantity, and attached take-profit/stop-loss of a pending order.

Request URL

POST /deepcoin/v2/trade/amend-order

Request Parameters

Field NameRequiredTypeDescription
instIdtruestringInstrument ID
ordIdfalsestringOrder ID. Either ordId or clOrdId is required. If both provided, ordId takes priority
clOrdIdfalsestringClient order ID, 1-20 alphanumeric characters. Either ordId or clOrdId is required
orderfalseobjectOrder price/size modification parameters. Either order or attachedTpSl is required
attachedTpSlfalseobjectAttached TP/SL modification parameters. Either order or attachedTpSl is required

order parameters:

Field NameRequiredTypeDescription
newPxfalsefloat64New price. Either newPx or newSz is required
newSzfalsefloat64New size. Either newPx or newSz is required

attachedTpSl parameters:

Field NameRequiredTypeDescription
newTpTriggerPxfalsefloat64New take-profit trigger price
newSlTriggerPxfalsefloat64New stop-loss trigger price
cancelTpfalseboolCancel the attached take-profit. Cannot be used with newTpTriggerPx
cancelSlfalseboolCancel the attached stop-loss. Cannot be used with newSlTriggerPx

Request Example

// Modify price only
{
"instId": "ETH-USDT-SWAP",
"ordId": "1000597858003301",
"order": {
"newPx": 1800
}
}

// Modify size only
{
"instId": "ETH-USDT-SWAP",
"ordId": "1000597858003301",
"order": {
"newSz": 2
}
}

// Modify both price and size
{
"instId": "ETH-USDT-SWAP",
"ordId": "1000597858003301",
"order": {
"newPx": 1850,
"newSz": 3
}
}

// Modify attached TP/SL
{
"instId": "ETH-USDT-SWAP",
"ordId": "1000597858003301",
"attachedTpSl": {
"newTpTriggerPx": 2200,
"newSlTriggerPx": 1700
}
}

// Cancel attached take-profit
{
"instId": "ETH-USDT-SWAP",
"ordId": "1000597858003301",
"attachedTpSl": {
"cancelTp": true
}
}

Response Parameters

Field NameTypeDescription
ordIdstringOrder ID
clOrdIdstringClient order ID
sCodestringResult code, 0 means success
sMsgstringResult message

Response Example

{
"ordId": "1000597858003301",
"clOrdId": "",
"sCode": "0",
"sMsg": "Success"
}