Amend order
Change the price, quantity, stop loss, take profit or trigger price of an open order. Send only the fields you want to change.
Modify an unfilled order by its UUID: its price and quantity, its stop loss (SL) and take profit (TP), and the trigger price of a waiting conditional order. The order's currency is inherited from its UUID; no trade_currency is needed. Send only the fields you want to change.
Request
# Change price and quantity
curl -X PATCH "https://trade.mudrex.com/fapi/v1/futures/orders/{order_id}" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"order_price": "0.05519",
"quantity": "110"
}'# Move a waiting conditional order's trigger
curl -X PATCH "https://trade.mudrex.com/fapi/v1/futures/orders/{order_id}" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"trigger_price": "0.05689"
}'# Change the order's stop loss (added if the order has none)
curl -X PATCH "https://trade.mudrex.com/fapi/v1/futures/orders/{order_id}" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"is_stoploss": true,
"stoploss_price": "0.05512"
}'# Add a LIMIT take profit to an order that has no SL/TP
curl -X PATCH "https://trade.mudrex.com/fapi/v1/futures/orders/{order_id}" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"tpsl_mode": "PARTIAL",
"is_takeprofit": true,
"takeprofit_price": "0.06224",
"takeprofit_order_type": "LIMIT",
"takeprofit_limit_price": "0.06227"
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id | string | Yes | The order UUID (path parameter). |
order_price | string | No | New order price (USDT). Not allowed on a conditional MARKET order. |
quantity | string | No | New quantity (base asset). |
trigger_price | string | No | New trigger price. Waiting conditional orders only. |
is_stoploss | boolean | No | Set to true to add, change or remove the order's SL. |
stoploss_price | string | Conditional | New SL trigger price. "0" removes the SL. |
stoploss_limit_price | string | No | New limit price. LIMIT SL only. |
is_takeprofit, takeprofit_price, takeprofit_limit_price | Same as the SL fields, for the TP. | ||
stoploss_order_type / takeprofit_order_type | string | No | MARKET or LIMIT. Used only when adding an SL/TP. You cannot change the trigger type (MARKET or LIMIT) of a stop loss or take profit once it is placed. A LIMIT SL/TP can be added only to a PARTIAL order. |
tpsl_mode | string | No | FULL or PARTIAL, in upper case. Accepted only while the order's current tpsl_mode is null. Once a mode is set, it can't be changed through Amend order. |
stoploss_order_id / takeprofit_order_id | string | No | Deprecated and ignored. The order's own SL/TP is updated directly. |
Response
Status: 200 OK
{
"success": true,
"data": {
"message": "Order updated successfully"
}
}Response fields
| Field | Description |
|---|---|
message | Status message. |
Read the order back with Order detail to confirm the change.
Notes
- Add or change an SL/TP: send
is_stoplosswith a price. No order id is needed. If the order has an SL, it is changed, or removed withstoploss_price: "0". Otherwise one is added. TP works the same way. - SL/TP mode: an order without SL/TP has
tpsl_mode: null.tpsl_modeis accepted on amend only while the order's current mode isnull; once a mode is set, it can't be changed through Amend order. Adding an SL/TP withouttpsl_modesets the mode toFULL. To add aLIMITSL/TP to an order with no mode, sendtpsl_mode: "PARTIAL"in the same request. Removing an order's last SL/TP returns its mode tonull. While the order has an SL/TP, its mode can't change. You cannot change the trigger type (MARKETorLIMIT) of a stop loss or take profit once it is placed. - After a partial fill, the order's SL/TP can be changed only through the position endpoints (Edit SL/TP).
- Waiting conditional order: its SL/TP are checked again against the new fill price when the trigger or order price changes. Its SL/TP can be changed or removed only here, not through the position endpoints or Cancel order.
- Close-on-trigger and reduce-only orders can't carry an SL/TP. Adding one is rejected.
- Unchanged values: sending the SL/TP price that is already set returns
200and leaves the SL/TP as it is.
Errors
Common errors
| HTTP | Error text | Meaning |
|---|---|---|
| 400 | nothing to amend | No field to change was sent, only tpsl_mode was sent, or a limit price was sent without is_stoploss / is_takeprofit. |
| 400 | stoploss_price or stoploss_limit_price is required when is_stoploss is true | is_stoploss sent without a price (TP likewise). |
| 400 | stoploss_price can't be negative | Negative SL price (TP likewise). |
| 400 | stoploss_limit_price can't be sent with stoploss_price 0, which removes the stoploss | Limit price sent with a removal (TP likewise). |
| 400 | a trigger price is required to add a stop loss or take profit | Adding an SL/TP with only a limit price. |
| 400 | a LIMIT stop loss or take profit can only be added to a PARTIAL order | LIMIT SL/TP added to an order whose mode is FULL or null, without tpsl_mode: "PARTIAL". |
| 400 | tpsl_mode can't change while the order has a stop loss or take profit | tpsl_mode sent for an order whose mode is already set. |
| 400 | limit price can only be set on a limit stop loss or take profit | Limit price sent for a MARKET SL/TP. |
| 400 | Params error | The exchange rejected the change, for example an SL/TP on the wrong side of the order price. |
| 400 | order is already filled or cancelled and can no longer be amended | The order is triggered, filled or cancelled. |
| 400 | stop loss or take profit can't be changed once the order is partially filled, update the position's stop loss or take profit instead | SL/TP change after a partial fill. |
| 400 | risk orders are not allowed on a Close on Trigger order | SL/TP on a close-on-trigger order. |
| 400 | stop loss or take profit can't be added to a reduce-only order | SL/TP on a reduce-only order. |
| 400 | trigger price can only be changed on a conditional order | trigger_price sent for a normal order. |
| 400 | trigger price can't be changed after the order has triggered | trigger_price sent after the trigger. |
| 400 | order price can't be set on a conditional market order | order_price sent for a conditional MARKET order. |
| 404 | stop loss or take profit not found for this order | Removing an SL/TP the order doesn't have. |
| 409 | action not allowed: another user action in progress or position may be under liquidation | The same SL/TP is being added or removed by another request. |
| 423 | action not allowed: another user action in progress or position may be under liquidation | Another action is in progress. Retry shortly. |
Trigger and limit price step, range and minimum value errors use the same texts as Create new order.
Updated 9 days ago
Did this page help you?
