# Order Details

Retrieve the latest status of a specific order through the API. Orders initiated by the user are accessible for one trading day and are automatically purged at the session's closure

**Endpoint**

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

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

{% 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="137">Parameter</th><th width="207">Sample/Possible Value</th><th width="118">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><tr><td>order_no</td><td>0123456789</td><td>Y</td><td>Order Number for which details are required</td></tr><tr><td>segment</td><td>E</td><td>Y</td><td>Segment of that order. "E" stands for Equity</td></tr></tbody></table>

#### **Request**

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

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

{% 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/details")
  .header("Authorization", "Bearer {{token}}")
  .header("Content-Type", "application/json")
  .body("{" +
          "\n    \"source\": \"N\"," +
          "\n    \"data\": {" +
          "\n        \"order_no\": \"1161240610102\"," +
          "\n        \"segment\": \"E\"" +
          "\n    }" +
          "\n}")
  .asString();
```

{% endcode %}
{% endtab %}

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

```go
package main

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

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

	payload := strings.NewReader(`{
    "source": "N",
    "data": {
        "order_no": "1161240610102",
        "segment": "E"
    }
}`)

	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" lineNumbers="true" %}

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

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

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

**Response Parameter**

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

```json
{
    "data": [
        {
            "order_no": "1141240514100",
            "good_till_days_date": "2024-05-14",
            "placed_by": "CUSTOMER",
            "symbol": "IDEA",
            "mkt_pro_flag": "N",
            "mkt_pro_value": 0,
            "pan_no": "BBTPS7354E",
            "instrument": "EQUITY",
            "source": "M",
            "remaining_quantity": 2,
            "disc_quantity": 0,
            "encash_flag": "N",
            "participant_type": "B",
            "price": 0,
            "traded_quantity": 0,
            "lot_size": 1,
            "order_type": "MKT",
            "security_id": "14366",
            "source_name": "MOB_WEB",
            "strike_price": 0,
            "product": "C",
            "settlor": "90245",
            "quantity": 2,
            "order_date_time": "2024-05-14 10:50:06",
            "expiry_date": "0001-01-01",
            "reason_description": "Fund Limit Insufficient. Insuff By 9.83 & Available Amount 15.77. Order Amount Is 25.60",
            "entity_id": "TOR001",
            "exch_order_no": "0",
            "display_name": "VODAFONE IDEA LIMITED",
            "product_name": "CNC",
            "exchange_inst_name": "Other",
            "last_updated_time": "2024-05-14 10:50:06",
            "trigger_price": 0,
            "placed_by_entity_id": "TOR001",
            "txn_type": "B",
            "series": "EQ",
            "exch_order_time": "0001-01-01 00:00:00",
            "opt_type": "XX",
            "exchange": "NSE",
            "error_code": "E0001",
            "validity": "DAY",
            "serial_no": 1,
            "mkt_type": "NL",
            "isin": "INE669E01016",
            "status": "Rejected"
        }
    ],
    "message": "Success",
    "status": "success"
}
```

{% endtab %}
{% endtabs %}

**Response Parameter**

<table><thead><tr><th width="216">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>entity_id</td><td>Identifier for the legal entity associated with the order.</td></tr><tr><td>exch_order_no</td><td>The unique number assigned by the exchange to the order.</td></tr><tr><td>exchange</td><td>The specific stock exchange where the order is placed (e.g., NYSE, NASDAQ).</td></tr><tr><td>txn_type</td><td>The type of transaction, such as 'buy' or 'sell'.</td></tr><tr><td>symbol</td><td>The ticker symbol representing the security being traded.</td></tr><tr><td>quantity</td><td>The total number of shares or contracts being ordered.</td></tr><tr><td>remaining_quantity</td><td>The number of shares or contracts that are yet to be traded.</td></tr><tr><td>traded_quantity</td><td>The number of shares or contracts that have already been traded.</td></tr><tr><td>product</td><td>Code representing the type of financial product being traded.</td></tr><tr><td>product_name</td><td>The full name of the financial product being traded.</td></tr><tr><td>order_date_time</td><td>The date and time when the order was initially entered into the system.</td></tr><tr><td>exch_order_time</td><td>The date and time when the order was received by the exchange.</td></tr><tr><td>last_updated_time</td><td>The most recent date and time when any details of the order were updated.</td></tr><tr><td>status</td><td>The current status of the order (e.g., pending, executed, cancelled).</td></tr><tr><td>price</td><td>The price at which the order is to be executed.</td></tr><tr><td>trigger_price</td><td>The specified price that triggers the execution of a stop order.</td></tr><tr><td>order_type</td><td>The type of order, such as 'market order' or 'limit order'.</td></tr><tr><td>error_message</td><td>Any error messages related to the order, if applicable.</td></tr><tr><td>disc_quantity</td><td>The portion of the order quantity that is disclosed to the market.</td></tr><tr><td>validity</td><td>The validity period of the order (e.g., 'day', 'GTC' for Good Till Cancelled).</td></tr><tr><td>serial_no</td><td>A unique serial number assigned to the order for tracking purposes.</td></tr><tr><td>source</td><td>The origin of the order (e.g., 'online', 'phone').</td></tr><tr><td>order_no</td><td>An internal order number used by the brokerage or trading system.</td></tr><tr><td>pan_no</td><td>The Permanent Account Number of the client, used for tax purposes.</td></tr><tr><td>participant_type</td><td>The type of participant placing the order (e.g., 'individual', 'institutional').</td></tr><tr><td>mkt_pro_flag</td><td>Indicates if the order is protected by market protection rules.</td></tr><tr><td>mkt_pro_value</td><td>The value associated with market protection rules for the order.</td></tr><tr><td>settlor</td><td>The entity responsible for settling the trade.</td></tr><tr><td>encash_flag</td><td>Indicates if the order is to be converted to cash.</td></tr><tr><td>mkt_type</td><td>The market type, such as 'regular' or 'after-hours'.</td></tr><tr><td>good_till_days_date</td><td>The specific date until which the order remains valid.</td></tr><tr><td>instrument</td><td>The name of the financial instrument being traded.</td></tr><tr><td>strike_price</td><td>The strike price for options contracts.</td></tr><tr><td>expiry_date</td><td>The expiry date for options or futures contracts.</td></tr><tr><td>opt_type</td><td>The type of option, such as 'call' or 'put'.</td></tr><tr><td>lot_size</td><td>The standard size of the lot in the order.</td></tr><tr><td>series</td><td>The series of the instrument.</td></tr><tr><td>isin</td><td>The International Securities Identification Number (ISIN) for the instrument.</td></tr><tr><td>display_name</td><td>A custom name used for displaying the symbol.</td></tr><tr><td>exchange_inst_name</td><td>The name of the instrument as per the exchange's listing.</td></tr><tr><td>error_code</td><td>A code that represents any errors encountered with the order.</td></tr><tr><td>placed_by</td><td>The identifier of the person who placed the order.</td></tr><tr><td>placed_by_entity_id</td><td>The identifier of the entity associated with the person who placed the order.</td></tr></tbody></table>
