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 Name | Required | Type | Description |
|---|---|---|---|
| instId | true | string | Instrument ID |
| ordId | false | string | Order ID. Either ordId or clOrdId is required. If both provided, ordId takes priority |
| clOrdId | false | string | Client order ID, 1-20 alphanumeric characters. Either ordId or clOrdId is required |
| order | false | object | Order price/size modification parameters. Either order or attachedTpSl is required |
| attachedTpSl | false | object | Attached TP/SL modification parameters. Either order or attachedTpSl is required |
order parameters:
| Field Name | Required | Type | Description |
|---|---|---|---|
| newPx | false | float64 | New price. Either newPx or newSz is required |
| newSz | false | float64 | New size. Either newPx or newSz is required |
attachedTpSl parameters:
| Field Name | Required | Type | Description |
|---|---|---|---|
| newTpTriggerPx | false | float64 | New take-profit trigger price |
| newSlTriggerPx | false | float64 | New stop-loss trigger price |
| cancelTp | false | bool | Cancel the attached take-profit. Cannot be used with newTpTriggerPx |
| cancelSl | false | bool | Cancel 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 Name | Type | Description |
|---|---|---|
| ordId | string | Order ID |
| clOrdId | string | Client order ID |
| sCode | string | Result code, 0 means success |
| sMsg | string | Result message |
Response Example
{
"ordId": "1000597858003301",
"clOrdId": "",
"sCode": "0",
"sMsg": "Success"
}