# Query order (USER_DATA)

## API Description

The current state of one order. This is the endpoint to poll after an `ACCEPTED` response.

For a **market** order it returns the execution record, including `dealId` and `positionId` once the
fill is known. For a **pending** order it returns the order, whether resting, filled, cancelled or
expired.

## HTTP Request

```http
GET /v1/order
```

## Request Weight

1

## Request Parameters

| Name | Type | Mandatory | Description |
| - | - | - | - |
| `login` | LONG | YES | |
| `orderId` | LONG | conditional | Send this or `origClientOrderId`. |
| `origClientOrderId` | STRING | conditional | The `newClientOrderId` used when placing. Works even before the trade server has assigned an `orderId`. For a pending order on the current server, see [Known limitations](/known-limitations.md#modify--cancel--query-by-origclientorderid-does-not-find-a-pending-order). |
| `recvWindow`, `timestamp`, `signature` | | | |

## Response Example

```json
{
  "login": 100123,
  "clientOrderId": "bot-001",
  "orderId": 44412345,
  "dealId": 55512345,
  "positionId": 44412345,
  "symbol": "XAUUSD",
  "side": "BUY",
  "type": "MARKET",
  "status": "FILLED",
  "volume": "0.10",
  "executedVolume": "0.10",
  "price": "2331.42",
  "stopLimitPrice": "0",
  "sl": "2320.00",
  "tp": "2350.00",
  "timeInForce": "GTC",
  "expiration": 0,
  "comment": "signal-7",
  "mt5RetCode": 10009,
  "time": 1789012345690,
  "updateTime": 1789012345812
}
```

| Field | Type | Description |
| - | - | - |
| `time` | LONG | When the order was accepted by this API, Unix ms. |
| `updateTime` | LONG | Last state change, Unix ms. |
| `orderId` | LONG | Absent until the trade server has assigned one. |
| `clientOrderId` | STRING | `""` for an order this API did not place (found by `orderId`). |
| everything else | | as on [`POST /v1/order`](/trade/new-order.md), except that `stopLimitPrice`, `sl`, `tp`, `timeInForce` and `expiration` are always present — `"0"` / `0` meaning none. |

Exactly one of `orderId` / `origClientOrderId` (`-1128` if both or neither). `-2013` if neither
identifier resolves for that `login`. An order belonging to a different login is
also `-2013` — never a permission error.

Orders are queryable by `origClientOrderId` for at least 24 hours and by `orderId` for as long as
the trade server retains them in history.
