Close Trade¶
Closes an existing open trade order for the authenticated client account.
DELETE
https://{some_domain}/trade/close
Authorization¶
All requests must include a JWT token:
Authorization: <JWT_TOKEN>
Request¶
Content-Type: application/json
Body Parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
order |
int | Yes | Trade order ID |
volume |
int | No | Partial close volume in minimal lots |
comment |
string | No | Optional comment |
expiration |
int64 | No | Optional expiration timestamp |
The client cannot set close_price or close_time. They are determined by the server.
Response¶
Success (200)¶
{
"accepted": true,
"order": 123456,
"state": 7,
"login": 1001,
"symbol": "EURUSD",
"cmd": 0,
"close_volume": 100
}
Error Responses¶
| Code | Error | Description |
|---|---|---|
| 400 | INVALID_DATA |
Validation failed |
| 401 | PERMISSION_DENIED |
Missing or invalid authenticated session |
| 403 | PERMISSION_DENIED |
Order does not belong to the authenticated session |
| 404 | RET_* |
Trade was not found |
| 4xx/5xx | RET_* |
Runtime validation or close error |