Get Trade By Order
GetTradeByOrder¶
Description:
Returns complete trade information for a specified order ID. This includes pricing, volume, profit, commission, swap (storage), and execution timestamps.
Access Control¶
🛡️ Access Level Required:
SESSION_USER,SESSION_MANAGER,SESSION_ADMIN,SESSION_DEALER
Endpoint¶
GET /trades/order/
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
| order | int | Yes | Trade order ID |
Request Example¶
{
"order": 1001234
}
Response¶
The response returns a data object containing trade fields.
| Field | Type | Description |
|---|---|---|
| order | int | Trade order ID |
| login | int | Account login |
| cmd | int | Trade command (BUY/SELL/etc.) |
| state | int | Trade state |
| symbol | string | Trading symbol |
| reason | int | Reason code |
| volume | int | Volume in minimal lots |
| open_time | int | Open timestamp |
| close_time | int | Close timestamp |
| open_price | double | Open price |
| close_price | double | Close price |
| sl | double | Stop Loss |
| tp | double | Take Profit |
| profit | double | Profit/Loss |
| commission | double | Commission |
| storage | double | Swap/Storage |
| comment | string | Trade comment |
| digits | int | Price precision digits |
| expiration | int | Expiration timestamp |
Example Response¶
{
"data": {
"order": 1001234,
"login": 123456,
"cmd": 0,
"state": 1,
"symbol": "EURUSD",
"reason": 2,
"volume": 1000,
"open_time": 1712000000,
"close_time": 0,
"open_price": 1.1010,
"close_price": 0,
"sl": 1.0900,
"tp": 1.1200,
"profit": 0.0,
"commission": -2.5,
"storage": -1.2,
"comment": "manual trade",
"digits": 5,
"expiration": 0
}
}
Error Responses¶
Validation Error¶
{
"error": "INVALID_DATA",
"message": "order is required"
}
Trade Not Found¶
{
"error": "TRADE_NOT_FOUND",
"message": "Trade with specified order ID not found"
}