# Order

| Field                | Value                                                                                                 | Type                                                                                                                                                           |
| -------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **account**          | Unique code of the account                                                                            | [Account code](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required** |
| **orderId**          | Internal numeric id of an order chain in the system                                                   | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required**       |
| **orderCode**        | Internal unique string code of an order chain in the system                                           | String, **required**                                                                                                                                           |
| **version**          | Numeric version of the account.                                                                       | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required**       |
| **clientOrderId**    | Unique order id assigned by the client during order placement                                         | [Client Id](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required**    |
| **actionCode**       | Internal unique code of the last order modification                                                   | String, **required**                                                                                                                                           |
| **legCount**         | Always 1                                                                                              | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required**       |
| **type**             | Order type                                                                                            | String, **required**                                                                                                                                           |
| **instrument**       | Symbol of the order’s instrument                                                                      | String, **required**                                                                                                                                           |
| **status**           | Status of the order                                                                                   | [Order Status](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required** |
| **finalStatus**      | Boolean value indicating if order is in final state                                                   | Boolean, **required**                                                                                                                                          |
| **legs**             | List of exactly 1 order leg                                                                           | [Order Leg](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/cash-transaction/order-leg), **required**                |
| **side**             | Side of the order. Either `BUY` (long) or `SELL` (short)                                              | String, **required**                                                                                                                                           |
| **tif**              | Time in force (expiration time for the order)                                                         | String, **required**                                                                                                                                           |
| **priceOffset**      | Price offset for protection orders                                                                    | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), *optional*         |
| **priceLink**        | Price link for protection orders                                                                      | String, *optional*                                                                                                                                             |
| **expireDate**       | Order expiration date in UTC                                                                          | Date, *optional*                                                                                                                                               |
| **openTime**         | Timestamp in UTC when this position was opened                                                        | Timestamp, **required**                                                                                                                                        |
| **openPrice**        | Price at which the position was opened                                                                | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), **required**       |
| **marginRate**       | Order margin rate                                                                                     | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), *optional*         |
| **issueTime**        | Timestamp in UTC when this order was accepted by the system                                           | Date, **required**                                                                                                                                             |
| **transactionTime**  | Timestamp in UTC of the last order modification or fill                                               | Date, **required**                                                                                                                                             |
| **links**            | List of the links between this order and other orders in its group                                    | Order Link, *optional*                                                                                                                                         |
| **executions**       | List of all executions for this order                                                                 | [Execution](#executions), *optional*                                                                                                                           |
| **cashTransactions** | List of all cash transactions related to this order. Reports are ordered chronologically.             | [Cash Transaction](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/cash-transaction), *optional*                     |
| **hedgedOrderId**    | For broker orders, a numeric id of the client order this order hedges. Included only for Dealer users | [Number](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/getting-started/data-types-and-formats), *optional*         |
| **externalOrderId**  | For broker orders, order id at the liquidity provider. Included only for Dealer users                 | String, *optional*                                                                                                                                             |

## *<mark style="color:blue;">**number**</mark>***&#x20;Order Id**

This value is assigned when an order is initially placed and does not change when an order is replaced or cancelled.

## *<mark style="color:blue;">**string**</mark>***&#x20;Order Code**

This value is assigned when an order is initially placed and does not change when an order is replaced or cancelled.

***number*****&#x20;Version**

Numeric version of the account to which last update of this order is related. Client can use this value to find out which of the updates is more recent (its version is greater).

## *<mark style="color:blue;">**string**</mark>***&#x20;Order Type**

Possible values:

* `MARKET`
* `LIMIT`
* `STOP`

## *<mark style="color:blue;">**string**</mark>***&#x20;TIF**

One of:

* `GTC` (Markets, Limits, Stops)
* `DAY` (Limits, Stops)
* `GTD` (Limits, Stops, in this case the `expireDate` field will be present)

## *<mark style="color:blue;">**number**</mark>***&#x20;Price Offset**

Price offset for protection orders. When parent order is triggered, either stop or limit price of protection order will be taken from parent trigger order's fill price with price offset. If this value is not null, the *priceLink* field must be present.

## *<mark style="color:blue;">**string**</mark>***&#x20;Price Link**

Price link for protection orders. Possible values:

* `TRIGGERED_STOP` - stop price of the order will be taken from parent trigger order's fill price
* `TRIGGERED_LIMIT` - limit price of the order will be taken from parent trigger order's fill price

## *<mark style="color:blue;">**date**</mark>***&#x20;Expiration Date**

Order expiration date in UTC. Must be present if the *tif* field is **GTD**. Otherwise, must be omitted.

## **Links**

Absent if the order is not a part of a group. Links are calculated only for the 'list-open-orders' request.

## **Executions**

List of all executions for this order. This includes order status changes, replaces, cancels and trades. Reports are ordered chronologically.
