Edit SL/TP
Modify previously set stop-loss or take-profit values on an open position.
Prices are USDT levels. The currency is inherited from the position.
stoploss_order_idandtakeprofit_order_idare required for the legs being edited. Omitting them returns400 risk order id missing. Fetch them from Open Positions (stoploss.order_id/takeprofit.order_id).
Request
curl -X PATCH "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/riskorder" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"stoploss_price": "0.095",
"takeprofit_price": "0.14",
"stoploss_order_id": "019ecc5d-d102-7c2e-a1ee-84df95bcc2c2",
"takeprofit_order_id": "019ecc5d-d102-7c31-97cb-33d44488c69b",
"is_stoploss": true,
"is_takeprofit": true,
"trigger_type": "MARKET"
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
position_id | string | Yes | The unique identifier of the position (path parameter). |
stoploss_price | number | Conditional | Required if is_stoploss is true. New stop loss price (USDT). |
takeprofit_price | number | Conditional | Required if is_takeprofit is true. New take profit price (USDT). |
stoploss_order_id | string | Conditional | Required to edit the SL leg. ID of the existing stop loss order. |
takeprofit_order_id | string | Conditional | Required to edit the TP leg. ID of the existing take profit order. |
trigger_type | string | No | Trigger type: MARKET or LIMIT. |
is_stoploss | boolean | No | Whether to update the stop loss order (default: false). |
is_takeprofit | boolean | No | Whether to update the take profit order (default: false). |
Response
Status: 200 OK
{
"success": true,
"data": {
"message": "Risk order amended successfully"
}
}Response fields
| Field | Description |
|---|---|
message | Status message. |
Errors
Common errors
Missing risk order id — stoploss_order_id / takeprofit_order_id not supplied.
{
"success": false,
"errors": [
{ "code": 400, "text": "risk order id missing" }
]
}Status: 400 Bad Request
Position not found
{
"success": false,
"errors": [
{ "code": 404, "text": "Position not found" }
]
}Status: 404 Not Found
Position not in OPEN state
{
"success": false,
"errors": [
{ "code": 400, "text": "Position is not in OPEN state" }
]
}Status: 400 Bad Request
