Square off
Close an entire open position immediately.
Close an entire open position immediately, by UUID. The currency is inherited from the position.
Request
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/close" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key"Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
position_id | string | Yes | The unique identifier of the position (path parameter). |
Response
Status: 200 OK
{
"success": true,
"data": {
"position_id": "019ecc5b-406a-7d43-be8b-c161aecf9c81",
"status": "CREATED",
"message": "OK"
}
}Response fields
| Field | Description |
|---|---|
position_id | ID of the position being closed. |
status | Status of the close operation (e.g. CREATED). |
message | Status message. |
Errors
Common errors
Position is not open
{
"success": false,
"errors": [
{
"code": 400,
"text": "position is not open"
}
]
}Status: 400 Bad Request
