> For the complete documentation index, see [llms.txt](https://faq.finerymarkets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faq.finerymarkets.com/api-reference/rest-api/trading/adding-orders/add.md).

# add

**POST /add**

{% tabs %}
{% tab title="Payload" %}

```json
{
    "instrument": "BTC-USD",
    "clientOrderId": 123456789,
    "price": 999900000000,
    "size": 10000000,
    "side": "bid",
    "type": "limitIOC",
    "cod": false
}
```

{% endtab %}

{% tab title="200 OK" %}

```json
{
    "id": 1245,
    "remainingSize": 8000000,
    "clientOrderId": 123456789,
    "cancelReason": 2,
    "deals": [
        {
            "counterpartyId": 42,
            "id": 23,
            "price": 999900000000,
            "size": 2000000,
            "volume": 19998000000,
            "delta": 0
        }
    ]
}
```

{% endtab %}

{% tab title="400 Bad request" %}

```json
{
    "error": 2
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Market Makers can place a maximum of 30 orders on a single side of the order book.
{% endhint %}

{% hint style="info" %}
There are several execution options for Takers:&#x20;

* For **Firm execution** only:

  `qsEnabled` should be =  `false` . `firmBookEnabled` = `true` must be set.&#x20;
* For **QS execution** with a specific LP:

  Set `qsEnabled` = `true` and specify `makers` = `[LP's ID]` . `firmBookEnabled` should be = `false`&#x20;
* For **automatic selection of the most competitive QS LPs** by FM:

  Set `qsEnabled` = `true` and specify `makers = [Array of LPs' IDs]` . `firmBookEnabled` should be = `false`&#x20;
* For **automatic selection of the best price between all available QS and aggregated Firm**:

  Set both `qsEnabled` = `true`  and `firmBookEnabled` = `true`&#x20;
  {% endhint %}

**Request parameters**

<table><thead><tr><th>Field name</th><th width="156.66666666666666">Type</th><th>Description</th></tr></thead><tbody><tr><td>instrument</td><td>string</td><td>Instrument name</td></tr><tr><td>clientOrderId</td><td>Efx::ClientOrderId</td><td>User data attached to the order</td></tr><tr><td>price</td><td>Efx::Price</td><td>Order limit price (for postOnly and limit orders)</td></tr><tr><td>size</td><td>Efx::Size</td><td>Order size. If specified - <code>volume</code> shouldn't be used</td></tr><tr><td>volume</td><td>Efx::Size</td><td>Order volume to be filled. Can be used by takers only. If specified - <code>size</code> shouldn't be used. By volume orders may be executed only in the Firm Book. Enabling QS will result into rejected order.</td></tr><tr><td>side</td><td>string</td><td>Order side, use <code>"bid"</code> to buy and <code>"ask"</code> to sell</td></tr><tr><td>type</td><td>string</td><td>Order types <code>"limitIOC"</code>, <code>"limitFOK"</code>, <code>"marketIOC"</code>, <code>"marketFOK"</code> can only be used by market takers. <code>"postOnly"</code> and <code>"limit"</code> can only be used by market makers.</td></tr><tr><td>cod</td><td>boolean</td><td>Cancel On Disconnect flag (will be used only within Web Socket authenticated connection)</td></tr><tr><td>qsEnabled</td><td>boolean</td><td>If true, adds QS as potential sources of liquidity for the order execution. If false or omitted, only Firm Book is considered. Can only be used by takers.<br>Defaults to true when omitted for orders by size and false for orders by volume.</td></tr><tr><td>firmBookEnabled</td><td>boolean</td><td>If true adds Firm Book as a potential source of liquidity for the order execution. If false, only QS are considered. Can only be used by takers.<br>Defaults to true when omitted.</td></tr><tr><td>makers</td><td>Array of Efx::ClientId</td><td>List of LPs to consider QS from. If empty or omitted, all available LPs considered. Taken into account <em><strong>only</strong></em> if qsEnabled == true and does not affect the Firm Book execution. Can only be used by takers.</td></tr></tbody></table>

**Response description**

| Filed name               | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id                       | Efx::OrderId         | New Order Id                                                                                                                                                                                                                                                                                                                                                                               |
| clientOrderId            | Efx::ClientOrderId   | Optional user data attached to the order                                                                                                                                                                                                                                                                                                                                                   |
| remainingSize            | Efx::Size            | Remaining Order size after aggressive deals (if order was placed by size)                                                                                                                                                                                                                                                                                                                  |
| remainingVolume          | Efx::Size            | Remaining Order size after aggressive deals (if order was placed by volume)                                                                                                                                                                                                                                                                                                                |
| cancelReason             | unsigned int16       | <p>Cancel Reason:</p><p>0 - the order is filled <em>(for Takers)</em></p><p>1 - by client <em>(for Market Makers)</em></p><p>2 - the order has been partially filled <em>(for Takers)</em></p><p>3 - by self-trade prevention (not in use)</p><p>4- on disconnect <em>(for Market Makers)</em><br>If "cancelReason" field is missing in response, it means that its value equals to 0.</p> |
| deals                    | array of objects     | Initial (taker) deals                                                                                                                                                                                                                                                                                                                                                                      |
| **Deal**                 |                      |                                                                                                                                                                                                                                                                                                                                                                                            |
| id                       | Efx::DealId          | Deal Id                                                                                                                                                                                                                                                                                                                                                                                    |
| price                    | Efx::Price           | Deal price                                                                                                                                                                                                                                                                                                                                                                                 |
| size                     | Efx::Size            | Deal size                                                                                                                                                                                                                                                                                                                                                                                  |
| volume                   | Efx::Size            | Deal volume                                                                                                                                                                                                                                                                                                                                                                                |
| delta                    | Efx::Size            | Deal delta in quote (balance) currency                                                                                                                                                                                                                                                                                                                                                     |
| counterpartyId           | unsigned int64       | Counterparty id                                                                                                                                                                                                                                                                                                                                                                            |
| counterpartySubaccountId | Efx::ClientId        | Сounterparty Subaccount Id                                                                                                                                                                                                                                                                                                                                                                 |
| liquiditySource          | Efx::LiquiditySource | Liquidity source for the deal (optional). Defaults to the firm book if absent.                                                                                                                                                                                                                                                                                                             |
