> 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/order-group-request.md).

# Order Group Request

Used to issue strategic order groups (e.g. `IF-THEN` or `OCO one-cancels-other`).

| Field               | Value                               | Type                                                                                                                                         |
| ------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **orders**          | List of orders in a group           | List of [Single Order Request](/sway-charts-api-documentation/rest-api-specification/cash-transaction/single-order-request.md), **required** |
| **contingencyType** | Relations between orders in a group | String, **required**                                                                                                                         |

## ***Single Order Request*****&#x20;Orders**

Orders in a group should have the same account and instrument.

Order groups can be issued only for Position-based accounts.

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

One of the following values (case-insensitive):

* `OCO` – orders in the group are OCO orders. Once one order gets into a final state, the other ones are cancelled. For this group the `OPEN` position effect and nonzero quantity should be set for both orders. Quantity should be equal for both orders. Note: OCO orders pair can be either traditional Limit/Stop pair with same side or pair with different sides, like Stop-Buy + Stop+Sell.
* `IF-THEN` – orders in the group are parent and contingents. The first order is considered a parent (`IF` order) and the other ones become active after parent is filled. The `IF` order should have OPEN position effect and nonzero quantity. The `THEN` order(s) should have CLOSE position effect and either zero or absent quantity ("position attached"). CLOSE order quantity will be assigned (with opposite sign) when `IF` order is fully filled. In case of order group cancellation, `THEN` orders will remain without quantity. The `THEN` orders should have the opposite SIDE from the `IF` order. `THEN` orders shall have only GTC TIF


---

# 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/order-group-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.
