curl --request POST \
--url https://api.example.com/api/v1/trade/close \
--header 'Content-Type: application/json' \
--data '
{
"orderId": "<string>"
}
'{
"message": "Order closed successfully",
"order": {
"orderId": "ord_1234567890abcdef",
"status": "CLOSED",
"closePrice": 42350.75,
"profit": 125.50
}
}
Close an existing open trading order
curl --request POST \
--url https://api.example.com/api/v1/trade/close \
--header 'Content-Type: application/json' \
--data '
{
"orderId": "<string>"
}
'{
"message": "Order closed successfully",
"order": {
"orderId": "ord_1234567890abcdef",
"status": "CLOSED",
"closePrice": 42350.75,
"profit": 125.50
}
}
Closes an existing open order for the authenticated user. The order is closed at the current market price and the position is settled.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lakshay-goyal/Exness/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <your_jwt_token>
200 - Order closed successfully400 - Missing orderId, order not found, or order already closed401 - Unauthorized - invalid or expired token500 - Internal server errorcurl -X POST https://api.exness.com/api/v1/trade/close \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"orderId": "ord_1234567890abcdef"
}'
{
"message": "Order closed successfully",
"order": {
"orderId": "ord_1234567890abcdef",
"status": "CLOSED",
"closePrice": 42350.75,
"profit": 125.50
}
}
curl -X POST https://api.exness.com/api/v1/trade/close \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{}'
{
"error": "Missing required parameters: orderId"
}
curl -X POST https://api.exness.com/api/v1/trade/close \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"orderId": "ord_nonexistent"
}'
{
"error": "Order not found or already closed",
"message": "Order not found or already closed"
}
{
"error": "Order ID mismatch"
}
/api/v1/trade/orders to see all open positions/api/v1/trade/close to see your trading history