> For the complete documentation index, see [llms.txt](https://sway-technologies.gitbook.io/sway-charts-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/cash-transaction/single-order-request.md).

# Single Order Request

| Field              | Value                                                                                                                      | Type                                                                                      |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| **orderCode**      | Unique order code that identifies the order on an account                                                                  | String, **required**                                                                      |
| **type**           | Order type                                                                                                                 | String, **required**                                                                      |
| **instrument**     | Symbol of the instrument                                                                                                   | String, **required**                                                                      |
| **quantity**       | Initial quantity of the order in units (not in lots)                                                                       | [Number](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=numbers), *optional*  |
| **positionEffect** | The effect of this order on a position                                                                                     | String, *optional*                                                                        |
| **positionCode**   | ID of a position that should be modified by this order                                                                     | String, *optional*                                                                        |
| **side**           | Order operation                                                                                                            | String, *required*                                                                        |
| **limitPrice**     | Limit order price per unit of quantity. (use **stopPrice** for stop orders). Should be absent for Market and Stop orders   | [Number](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=numbers), *optional*  |
| **stopPrice**      | Stop order price per unit of quantity. (use **limitPrice** for limit orders). Should be absent for Market and Limit orders | [Number](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=numbers), *optional*  |
| **priceOffset**    | Price offset for protection orders                                                                                         | [Number](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=numbers), *optional*  |
| **priceLink**      | Price link for protection orders                                                                                           | String, *optional*                                                                        |
| **tif**            | Time in force (expiration time for the order)                                                                              | String, *optional*                                                                        |
| **expireDate**     | Order expiration date in UTC                                                                                               | [Date](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=date-times), *optional* |

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

Order code for new orders is the unique id assigned by the client. The id is expected to be unique among all orders on an account. [See Client-originated Identifiers](/sway-charts-api-documentation/rest-api-specification/getting-started/conditional-requests-and-updates.md). For modify order requests the order code can be either a client order id (as assigned by the client during order placement) or an internal code assigned by the system ("action key" of the order chain).

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

Possible values:

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

Order type cannot be changed after the order is issued. The value must be omitted in ‘Replace’ requests except group requests, which may contain new orders in Replace requests.

## *<mark style="color:blue;">string</mark>* Instrument

Instrument cannot be changed after the order is issued. In 'Modify' requests instrument must be the same as in original order.

## *<mark style="color:blue;">number</mark>* Quantity

Must be omitted or be zero for a ‘closing’ order linked to a position. In this case the *positionCode* field must be present and *positionEffect* should be set to ‘Close’. In this case quantity of the order will equal to the quantity of the position.

## *<mark style="color:blue;">string</mark>* Position Effect

Indicates whether the resulting position after a trade should be a new position or the trade should close an existing position. Required for position-based trading. If the value is ‘Close’, the *positionCode* field must be present.

Possible values:

* `OPEN`
* `CLOSE`

## *<mark style="color:blue;">string</mark>* Position Code

ID of a position that should be modified by this order. Used for position based trading. Must be present when *positionEffect* is ‘Close’ and omitted otherwise.

## *<mark style="color:blue;">string</mark>* Side

Possible values are :

* `BUY`
* `SELL`

## *<mark style="color:blue;">number</mark>* 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>* 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;">**string**</mark>***&#x20;TIF**

Time in force (expiration time for the order). One of:

* `GTC` (Markets, Limits, Stops)
* `DAY` (Limits, Stops)
* `GTD` (Limits, Stops, requires the *expireDate* field)

Default value depends on the platform configuration.

## *<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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sway-technologies.gitbook.io/sway-charts-api-documentation/rest-api-specification/cash-transaction/single-order-request.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
