> For the complete documentation index, see [llms.txt](https://tradesync.gitbook.io/tradesync/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tradesync.gitbook.io/tradesync/fxtr-v2/functions-of-fxtr-v2/open-stream-for-the-account/messages-that-can-be-sent-in-open-stream/getorders.md).

# GetOrders

**`GetOrders`** - request a list of currently opened positions and pending/limit orders.

Example:

`{"id": 11, "type":"GetOrders", "body": {}}`

**Request Body Fields:** n/a.

**Responce Type** - `Orders.`

**Responce Body Fields:**

<table><thead><tr><th>Parameter</th><th width="170" data-type="checkbox">Always returned</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>balance</code></td><td>true</td><td><code>string</code> </td><td>current balance of the trading account</td></tr><tr><td><code>equity</code></td><td>true</td><td><code>float</code></td><td>current equity of the trading account</td></tr><tr><td><code>credit</code></td><td>true</td><td><code>float</code></td><td>current credit of the trading account</td></tr><tr><td><code>margin</code></td><td>true</td><td><code>double</code></td><td>margin of the trading account</td></tr><tr><td><code>margin_level</code></td><td>true</td><td><code>float</code></td><td>margin level of the trading account</td></tr><tr><td><code>currency</code></td><td>true</td><td><code>string</code> </td><td>currency of the trading account</td></tr><tr><td><code>orders</code></td><td>true</td><td></td><td>an array of currently active positions with the following (see the table <strong>Orders</strong>)</td></tr><tr><td><code>pendings</code></td><td>false</td><td></td><td>an array (see the table <strong>Pendings</strong>)</td></tr></tbody></table>

**Orders**

<table><thead><tr><th width="240">Parameter</th><th width="166.33333333333331" data-type="checkbox">Always returned</th><th>Description</th></tr></thead><tbody><tr><td><code>ticket</code></td><td>true</td><td>the ticket of a deal</td></tr><tr><td><code>position</code></td><td>true</td><td>the position ID (ticket) specified in the deal</td></tr><tr><td><code>price</code></td><td>true</td><td>the price at which the deal was executed</td></tr><tr><td><code>current_price</code></td><td>true</td><td>the current price of symbol</td></tr><tr><td><code>volume</code></td><td>true</td><td>the volume of a deal in lots</td></tr><tr><td><code>type</code></td><td>true</td><td>the order type, can 0 - for buy and 1 for sell</td></tr><tr><td><code>symbol</code></td><td>true</td><td>the symbol, for which the deal was executed</td></tr><tr><td><code>comment</code></td><td>true</td><td>a comment to a deal</td></tr><tr><td><code>sl</code></td><td>true</td><td>the Stop Loss level of a trade</td></tr><tr><td><code>tp</code></td><td>true</td><td>the Take Profit level of a trade</td></tr><tr><td><code>commission</code></td><td>true</td><td>the commision</td></tr><tr><td><code>swap</code></td><td>true</td><td>the swap value of a trade in the trading account currency</td></tr><tr><td><code>profit</code></td><td>true</td><td>current profit/loss of a trade in the trading account currency</td></tr><tr><td><code>maring_rate</code></td><td>true</td><td> the exchange rate of the margin currency of a trade to the trading account currency</td></tr><tr><td><code>state</code></td><td>true</td><td>the current state of a trade (always 0)</td></tr><tr><td><code>time_created</code></td><td>true</td><td>creation time in milliseconds in UTC</td></tr><tr><td><code>time_updated</code></td><td>true</td><td>update time in milliseconds in UTC</td></tr></tbody></table>

**Pendings**

<table><thead><tr><th>Parameter</th><th width="176.33333333333331" data-type="checkbox">Always returned</th><th></th></tr></thead><tbody><tr><td><code>ticket</code></td><td>true</td><td>the ticket of an order</td></tr><tr><td><code>position</code></td><td>true</td><td>the position ID (ticket) specified in the order</td></tr><tr><td><code>price</code></td><td>true</td><td>the price at which the order was executed</td></tr><tr><td><code>price_trigger</code></td><td>true</td><td>the price, at which a Limit order is placed when the Stop Limit order triggers</td></tr><tr><td><code>price_current</code></td><td>true</td><td>the current price of symbol</td></tr><tr><td><code>volume</code></td><td>true</td><td>the volume of the order in lots</td></tr><tr><td><code>type</code></td><td>true</td><td><p></p><p>the order type, can be:</p><ul><li>0 - BUY</li><li>1 - SELL</li><li>2 - BUY LIMIT</li><li>3 - SELL LIMIT</li><li>4 - BUY STOP</li><li>5 - SELL STOP</li><li>6 - BUY STOP LIMIT </li><li>7 - SELL STOP LIMIT</li></ul></td></tr><tr><td><code>symbol</code></td><td>true</td><td>the symbol, for which the order was executed</td></tr><tr><td><code>comment</code></td><td>true</td><td> a comment to an order</td></tr><tr><td><code>sl</code></td><td>true</td><td>the Stop Loss level of an order</td></tr><tr><td><code>tp</code></td><td>true</td><td>the Take Profit level of am order</td></tr><tr><td><code>commission</code></td><td>true</td><td>the commision</td></tr><tr><td><code>swap</code> </td><td>true</td><td>the swap value of a trade in the trading account currency</td></tr><tr><td><code>profit</code> </td><td>true</td><td>current profit/loss of an order in the trading account currency</td></tr><tr><td><code>maring_rate</code></td><td>true</td><td>the exchange rate of the margin currency of a trade to the trading account currency</td></tr><tr><td><code>state</code></td><td>true</td><td><p></p><p>the current state of an order, can be:</p><ul><li>1 - placed</li><li>3 - partially filled</li></ul></td></tr><tr><td><code>time_created</code></td><td>true</td><td>creation time in milliseconds in UTC</td></tr><tr><td><code>time_updated</code></td><td>true</td><td>update time in milliseconds in UTC</td></tr></tbody></table>

**Example:**

```json
{
    "type": "Orders",
    "id": 11,
    "body": {
        "balance": 1052.45,
        "equity": 1051,
        "credit": 0,
        "margin": 10.78,
        "margin_level": 9749.54,
        "free_margin": 1040.22,
        "currency": "USD",
        "orders": [
            {
                "ticket": 969106,
                "position_id": 969106,
                "price": 1.077570,
                "current_price": 1.076190,
                "volume": 0.010000,
                "type": 0,
                "symbol": "EURUSD.r",
                "comment": "",
                "sl": 0.000000,
                "tp": 0.000000,
                "commission": 0,
                "swap": -0.070000,
                "profit": -1.380000,
                "margin_rate": 1.077570,
                "state": 0,
                "time_created": 1686234765329,
                "time_updated": 1686234765329
            }
        ],
        "pendings": [
            {
                "ticket": 969163,
                "position_id": 0,
                "type": 2,
                "price": 1.000000,
                "price_trigger": 0.000000,
                "price_current": 1.076200,
                "volume": 0.010000,
                "symbol": "EURUSD.r",
                "comment": "",
                "sl": 0.000000,
                "tp": 0.000000,
                "commission": 0,
                "swap": 0,
                "profit": 0,
                "margin_rate": 1.000000,
                "state": 1,
                "time_created": 1686299668891,
                "time_updated": 1686299668891
            }
        ]
    }
}
```
