# Order Book

This API will retrieve the list of orders placed for the current day. Orders initiated by the user remain active for a day and are automatically cleared after the trading session.

#### Endpoint

{% code title="Base URL" overflow="wrap" fullWidth="false" %}

```
https://connects.torusdigital.com/api/v1/order/book
```

{% endcode %}

#### Header Parameters <a href="#header-parameters" id="header-parameters"></a>

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

#### **Request Parameter**

<table><thead><tr><th width="122">Name</th><th width="94">Value</th><th width="163">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>source</td><td>N</td><td>Y</td><td>Source of the request (e.g., "N")</td></tr></tbody></table>

#### **Request**

{% tabs %}
{% tab title="curl" %}
{% code title="cURL" overflow="wrap" fullWidth="true" %}

```javascript
curl --location 'https://connects.torusdigital.com/api/v1/order/book' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "source": "N"
}'
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code title="Java-Unirest" fullWidth="false" %}

```java
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://connects.torusdigital.com/api/v1/order/book")
  .header("Authorization", "Bearer {{token}}")
  .header("Content-Type", "application/json")
  .body("{\n    \"source\": \"N\"\n}")
  .asString();
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code title="Go-Native" overflow="wrap" fullWidth="true" %}

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {
	url := "https://connects.torusdigital.com/api/v1/order/book"
	method := "POST"

	payload := strings.NewReader(`{
		"source": "N"
	}`)

	client := &http.Client{}
	req, err := http.NewRequest(method, url, payload)
	if err != nil {
		fmt.Println(err)
		return
	}
	req.Header.Add("Authorization", "Bearer {{token}}")
	req.Header.Add("Content-Type", "application/json")

	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer res.Body.Close()

	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(string(body))
}
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code title="JavaScript-JQuery" overflow="wrap" %}

```javascript
var settings = {
  "url": "https://connects.torusdigital.com/api/v1/order/book",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {{token}}",
    "Content-Type": "application/json"
  },
  "data": JSON.stringify({
    "source": "N"
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}
{% code overflow="wrap" fullWidth="false" %}

```json
{
    "data": [
        {
            "algo_id": "0",
            "algo_ord_no": "0",
            "avg_traded_price": 0,
            "child_leg_unq_id": 0,
            "client_id": "007",
            "disc_quantity": 0,
            "display_name": "VODAFONE IDEA LIMITED",
            "dq_qty_rem": 0,
            "encash_flag": "N",
            "error_code": "0",
            "exch_order_no": "1400000000000047",
            "exch_order_time": "2024-06-11 12:35:43",
            "exchange": "NSE",
            "exchange_inst_name": "Other",
            "expiry_date": "0001-01-01",
            "expiry_flag": "NA",
            "good_till_days_date": "2024-06-11",
            "group_id": 1,
            "identifier": "0",
            "instrument": "EQUITY",
            "isin": "INE669E01016",
            "last_updated_time": "2024-06-11 12:35:43",
            "leg_no": 1,
            "lot_size": 1,
            "mkt_pro_flag": "N",
            "mkt_pro_value": 0,
            "mkt_type": "NL",
            "off_mkt_flag": "0",
            "opt_type": "XX",
            "order_date_time": "2024-06-11 12:35:43",
            "order_no": "1121240611100",
            "order_type": "LMT",
            "pan_no": "ABCDE1264F",
            "participant_type": "B",
            "placed_by": "007",
            "placed_by_entity_id": "007",
            "pr_abstick_value": 0,
            "price": 15.77,
            "product": "I",
            "product_name": "INTRADAY",
            "quantity": 1,
            "reason_description": "MKT to Limit Conversion",
            "ref_ltp": 13.15,
            "rem_qty_tot_qty": "1/1",
            "remaining_quantity": 1,
            "remarks": "502929",
            "remarks1": "NA",
            "remarks2": "NA",
            "row_no": 0,
            "security_id": "14366",
            "segment": "E",
            "serial_no": 2,
            "series": "EQ",
            "settlor": "90245",
            "sl_abstick_value": 0,
            "source": "MOBILE",
            "source_name": "MOB_WEB",
            "status": "Pending",
            "strategy_id": "NA",
            "strike_price": 0,
            "symbol": "IDEA",
            "tick_size": 1,
            "traded_price": 0,
            "traded_qty": 0,
            "trailing_sl_value": 0,
            "trigger_price": 0,
            "txn_type": "B",
            "validity": "DAY"
        }
    ],
    "message": "Success",
    "status": "success"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Response Parameter**

<table><thead><tr><th width="205">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>client_id</td><td>ClientID - Unique identifier for the client.</td></tr><tr><td>order_date_time</td><td>Order Entry DateTime - Date and time when the order was entered.</td></tr><tr><td>last_updated_time</td><td>LastUpdated time - Timestamp indicating when the order details were last updated.</td></tr><tr><td>order_no</td><td>Order Number - Unique identifier for the order.</td></tr><tr><td>exchange</td><td>Exchange - The exchange where the order is placed (e.g., NSE, BSE).</td></tr><tr><td>txn_type</td><td>Transaction Type - Type of transaction (e.g., Buy, Sell).</td></tr><tr><td>segment</td><td>Segment - The segment of the market (e.g., Equity, Derivatives..)</td></tr><tr><td>instrument</td><td>Instrument - Type of financial instrument.</td></tr><tr><td>symbol</td><td>Symbol - The trading symbol of the security.</td></tr><tr><td>product</td><td>Product - Type of product (e.g., C, M, I, H).</td></tr><tr><td>product_name</td><td>Product Name - Name of the product.</td></tr><tr><td>status</td><td>Status of order - Current status of the order (e.g., Success, Error).</td></tr><tr><td>quantity</td><td>Quantity - The total quantity of the order.</td></tr><tr><td>remaining_quantity</td><td>Quantity Remaining - Remaining quantity of the order.</td></tr><tr><td>price</td><td>Price - The price at which the order is placed.</td></tr><tr><td>trigger_price</td><td>Trigger Price - Price at which the order gets triggered.</td></tr><tr><td>order_type</td><td>Order Type - Type of order (e.g., Limit, Market, Stop Loss).</td></tr><tr><td>disc_quantity</td><td>DiscloseQuantity - Quantity disclosed by the user.</td></tr><tr><td>serial_no</td><td>Serial Number - Unique serial number assigned to the order.</td></tr><tr><td>security_id</td><td>Security Id - Identifier for the security being traded.</td></tr><tr><td>validity</td><td>Order Validity - Validity period of the order (e.g., IOC, DAY).</td></tr><tr><td>lot_size</td><td>Regular Lotsize - Standard lot size for trading the instrument.</td></tr><tr><td>rem_qty_tot_qty</td><td>RemainingQty/Total Qty - Remaining quantity compared to total quantity.</td></tr><tr><td>traded_qty</td><td>Executed Quantity - Quantity of the order that has been executed.</td></tr><tr><td>dq_qty_rem</td><td>DiscloseQty Remaining - Remaining disclosed quantity.</td></tr><tr><td>exch_order_no</td><td>ExchangeOrder Number - Unique identifier for the order assigned by the exchange.</td></tr><tr><td>exch_order_time</td><td>ExchangeOrder time - Time when the order was received by the exchange.</td></tr><tr><td>reason_description</td><td>Reason - Description of the reason for a particular action or event.</td></tr><tr><td>leg_no</td><td>Leg Value - Value indicating the leg of an order.</td></tr><tr><td>row_no</td><td>Row number/index - Index or position of the order in a dataset or list.</td></tr><tr><td>traded_price</td><td>Traded Price - The price at which the trade was executed.</td></tr><tr><td>avg_traded_price</td><td>Average Traded Price - The average price at which trades were executed.</td></tr><tr><td>pan_no</td><td>PAN Number - Permanent Account Number of the client.</td></tr><tr><td>participant_type</td><td>Participant Type - Type of participant (e.g., Client, Dealer).</td></tr><tr><td>mkt_pro_flag</td><td>Market Protection Flag - Indicator for market protection.</td></tr><tr><td>mkt_pro_value</td><td>MarketProtection Value - Value associated with market protection.</td></tr><tr><td>settlor</td><td>Settlor - The entity responsible for settlement.</td></tr><tr><td>encash_flag</td><td>Encash Flag - Indicator if the encashment is allowed.</td></tr><tr><td>mkt_type</td><td>Market Type - Type of market (e.g. NL, OL, AU, SP, A1, A2).</td></tr><tr><td>algo_ord_no</td><td>Algo Order Number - Identifier for the algorithmic order.</td></tr><tr><td>trailing_sl_value</td><td>Trailing Stoploss Price - Price set for trailing stoploss.</td></tr><tr><td>sl_abstick_value</td><td>Stoploss Price - Price set for stoploss.</td></tr><tr><td>pr_abstick_value</td><td>Profit Price - Price set for profit.</td></tr><tr><td>off_mkt_flag</td><td>OrderOffOn - Indicator for order being off-market.</td></tr><tr><td>child_leg_unq_id</td><td>Child Leg Id - Unique identifier for the child leg of a multi-leg order.</td></tr><tr><td>strike_price</td><td>Strike Price - The price at which the option contract can be exercised.</td></tr><tr><td>expiry_date</td><td>Expiry Date - The expiration date of the derivative contract.</td></tr><tr><td>opt_type</td><td>Option Type - The type of option (e.g., Call, Put).</td></tr><tr><td>Series</td><td>Series - Series of the security (e.g., EQ for equities).</td></tr><tr><td>good_till_days_date</td><td>Good Till Days Date - Date until the order remains valid.</td></tr><tr><td>group_id</td><td>Group Id - Identifier for the group to which the order belongs.</td></tr><tr><td>Isin</td><td>ISIN code - International Securities Identification Number.</td></tr><tr><td>display_name</td><td>Custom Symbol Name - Custom name for the symbol.</td></tr><tr><td>exchange_inst_name</td><td>InstrumentName - Name of the instrument on the exchange.</td></tr></tbody></table>
