> For the complete documentation index, see [llms.txt](https://ajaib.gitbook.io/ajaib-exchange-open-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajaib.gitbook.io/ajaib-exchange-open-api/api-references/markdown/create-new-order.md).

# Create New Order

## Creates a new order under exchange client

<mark style="color:green;">`POST`</mark> `/v1/order`

**Functionality:** Creates a new (spot trading) order belonging to the exchange client's trading account.&#x20;

A successful response returned simply means the exchange has received (order) instructions to act upon. However, it is no guarantee all (order) instructions have been processed successfully.

**Authentication**: Required

#### Request Body

Supported content type `application/x-www-form-urlencoded`

<table><thead><tr><th width="195">Name</th><th width="99">Type</th><th width="160" data-type="checkbox">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>string</td><td>true</td><td>Symbol of trading pair. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=Asset%20Symbols%20/%20Trading%20Pairs">this</a>.</td></tr><tr><td>type</td><td>string</td><td>true</td><td>Type of order. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=Bitcoin%3B%20USD%20Tether-,Order%20Types,-Enum">this</a>.</td></tr><tr><td>side</td><td>string</td><td>true</td><td>Side of order book. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=will%20be%20expired).-,Order%20Sides,-Enum">this</a>.</td></tr><tr><td>price</td><td>decimal</td><td>false</td><td><p>Price of order.</p><p></p><p>Mandatory for order type <code>LIMIT</code> &#x26; <code>LIMIT_MAKER</code></p></td></tr><tr><td>quantity</td><td>decimal</td><td>false</td><td><p>Quantity of order.</p><p></p><p>Mandatory for order type  <code>LIMIT</code> &#x26; <code>LIMIT_MAKER</code></p></td></tr><tr><td>quoteOrderQty</td><td>decimal</td><td>false</td><td>Amount of order (required for MARKET order type)</td></tr><tr><td>newClientOrderId</td><td>string</td><td>true</td><td>A unique id from client among open orders. This field need to be send in UUIDv4 format. Orders with the same <code>client_order_id</code> can be accepted only when the previous one if completed, otherwise the order will be rejected.</td></tr><tr><td>selfTradePreventionMode</td><td>string</td><td>false</td><td>Self trade prevention mode. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=End%20of%20state.-,Self%20Trade%20Prevention,-There%20are%20four">this</a>.</td></tr><tr><td>timeInForce</td><td>string</td><td>false</td><td>Time in force mode. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart">this</a>.</td></tr><tr><td>recvWindow</td><td>long</td><td>false</td><td>Number of milliseconds after timestamp the request is valid for. Refer to <a href="https://ajaib.gitbook.io/ajaib-exchange-open-api/getting-started/timing-security">this</a>.</td></tr><tr><td>timestamp</td><td>long</td><td>true</td><td>Timestamp when client sending request.</td></tr></tbody></table>

{% tabs %}
{% tab title="Request Sample - LIMIT Order" %}

```javascript
{
  "symbol": "BTC_USDT",
  "type": "LIMIT",
  "side": "SELL",
  "price": "0.00000000",
  "quantity": "10.00000000",
  "newClientOrderId": "de7fad3e-d13e-41fb-973e-967065b42a56"
  "selfTradePreventionMode": "NONE",
  "timeInForce": "GTC",
  "recvWindow": 5000,
  "timestamp": 1499827319559
}
```

{% endtab %}

{% tab title="Request Sample - MARKET Order" %}

```
{
  "symbol": "BTC_USDT",
  "type": "MARKET",
  "side": "SELL",
  "quoteOrderQty": "10.00000000",
  "newClientOrderId": "de7fad3e-d13e-41fb-973e-967065b42a56"
  "selfTradePreventionMode": "NONE",
  "timeInForce": "GTC",
  "recvWindow": 5000,
  "timestamp": 1499827319559
}
```

{% endtab %}
{% endtabs %}

**Response Body**

<table><thead><tr><th width="186">Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>string</td><td>Symbol of trading pair. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=Asset%20Symbols%20/%20Trading%20Pairs">this</a>.</td></tr><tr><td>orderId</td><td>string</td><td>Unique identifier generated by Ajaib exchange for orders submitted successfully</td></tr><tr><td>clientOrderId</td><td>string</td><td>Order identifier from client side.</td></tr><tr><td>type</td><td>string</td><td>Type of order. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=Bitcoin%3B%20USD%20Tether-,Order%20Types,-Enum">this</a>.</td></tr><tr><td>side</td><td>string</td><td>Side of order book. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=will%20be%20expired).-,Order%20Sides,-Enum">this</a>.</td></tr><tr><td>price</td><td>string</td><td>Requested price of order.</td></tr><tr><td>origQty</td><td>string</td><td>Requested quantity of order.</td></tr><tr><td>executedQty</td><td>string</td><td>Total order quantity already matched or executed.</td></tr><tr><td>origQuoteOrderQty</td><td>string</td><td>Requested amount of order.</td></tr><tr><td>cummulativeQuoteQty</td><td>string</td><td>Total order amount already matched or executed.</td></tr><tr><td>status</td><td>string</td><td>Status of order. Refer to <a href="https://app.gitbook.com/o/LdxNUhLARU4i5PWgRIYE/s/QFDWMfeUb31y6zAF2lKc/getting-started/quickstart#asset-symbols-trading-pairs:~:text=Order%20Status%20%26%20Lifecycle,Comment">this</a>.</td></tr><tr><td>timeInForce</td><td>string</td><td>Time in force mode. Refer to <a href="https://app.gitbook.com/o/LdxNUhLARU4i5PWgRIYE/s/QFDWMfeUb31y6zAF2lKc/~/changes/4/getting-started/quickstart#:~:text=Time%20in%20Force,Comment">this</a>.</td></tr><tr><td>selfTradePreventionMode</td><td>string</td><td>Self trade prevention mode. Refer to <a href="https://ajaib.gitbook.io/coin-exchange-open-api/getting-started/quickstart#:~:text=End%20of%20state.-,Self%20Trade%20Prevention,-There%20are%20four">this</a>.</td></tr><tr><td>time</td><td>long</td><td>Timestamp when order received in our system</td></tr><tr><td>updateTime</td><td>long</td><td>Timestamp when order updated</td></tr></tbody></table>

{% tabs %}
{% tab title="200 OK" %}

```javascript
{

  "symbol": "BTC_USDT",
  "orderId": "de7fad3e-d13e-41fb-973e-967065b42a54",
  "clientOrderId": "de7fad3e-d13e-41fb-973e-967065b42a56",
  "price": "0.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "origQuoteOrderQty": "0.000000",
  "cummulativeQuoteQty": "10.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "side": "SELL",
  "selfTradePreventionMode": "NONE",
  "time": 1499827319559,
  "updateTime": 1499827319559,
}
```

{% endtab %}

{% tab title="401 Unauthorized" %}

```
{
  "code": -1002,
  "msg": "Unauthorized"
}
```

{% endtab %}
{% endtabs %}
