Guides
Guides

Partial Close

Close a portion of an open position without exiting entirely.

Request

curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/close/partial" \
  -H "Content-Type: application/json" \
  -H "X-Authentication: your-secret-key" \
  -d '{
    "order_type": "LIMIT",
    "quantity": "0.01",
    "limit_price": "102.75"
  }'

Parameters

ParameterTypeRequiredDescription
position_idstringYesThe unique identifier of the position (path parameter)
order_typestringYesOrder type: LIMIT or MARKET
quantitystringYesQuantity to close (must be less than the total position quantity)
limit_pricestringConditionalRequired if order_type is LIMIT. Price at which to close the partial position

Response

{
    "success": true,
    "data": true
}

Common errors

Position is not open

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "position is not open"
        }
    ]
}

Status: 400 Bad Request

Occurs when attempting to partially close a position that is not currently open.