# Trade Details

This API endpoint Retrieves the trade details and transaction history for a client's trading account. Provides access to information about executed trades, including order details, product information, trade prices, quantities, and timestamps for monitoring and record-keeping purposes

**Endpoint**

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

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

{% endcode %}

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

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

#### **Request Parameters**

| Parameter | Sample/Possible Value | Mandatory | Description                                       |
| --------- | --------------------- | --------- | ------------------------------------------------- |
| source    | N                     | Y         | Source of the request (e.g., "N")                 |
| order\_no | 0123456789            | Y         | Order Number for which trade details are required |
| segment   | E/D/C/M               | Y         | Segment of that order                             |

#### **Request**

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

```javascript
curl --location 'https://connects.torusdigital.com/api/v1/trade/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/trade/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"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {
	url := "https://connects.torusdigital.com/api/v1/trade/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" lineNumbers="true" fullWidth="false" %}

```javascript
var settings = {
  "url": "https://connects.torusdigital.com/api/v1/trade/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**

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

```json
{
    "data": [
        {
            "order_date_time": "2022-03-11 13:21:40",
            "exch_order_time": "2022-03-11 13:22:13",
            "exch_trade_time": "2022-03-11 13:22:12",
            "last_updated_time": "2022-03-11 13:22:12",
            "order_no": 112203112023,
            "exch_order_no": "1100000000048471",
            "exchange": "NSE",
            "txn_type": "S",
            "segment": "E",
            "order_type": "MKT",
            "symbol": "ITC",
            "product": "C",
            "product_name": "CNC",
            "quantity": 91,
            "traded_price": 232.00000,
            "trade_value": 21112.0,
            "trade_no": 50038631,
            "security_id": "1660",
            "row_no": 0,
            "pan_no": "AAAAA0005A",
            "participant_type": "B",
            "mkt_pro_flag": "N",
            "mkt_pro_value": 0.0,
            "settlor": "90061",
            "encash_flag": "N",
            "mkt_type": "NL",
            "strike_price": 0.00000,
            "expiry_date": "0001-01-01",
            "opt_type": "XX",
            "instrument": "EQUITY",
            "lot_size": 1.0,
            "series": "EQ",
            "isin": "INE154A01025",
            "display_name": "ITC",
            "exchange_inst_name": "ES",
            "placed_by": "ADMIN",
            "tick_size": 5.00000,
            "algo_id": "0",
            "placed_by_entity_id": "SYSADMIN1"
        }
    ],
    "message": "Success",
    "status": "success"
}
```

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

&#x20;   **Response Parameter**

| Parameter              | Description                                                                       |
| ---------------------- | --------------------------------------------------------------------------------- |
| order\_date\_time      | Order Entry Date Time - The date and time when the order was entered.             |
| exch\_order\_time      | Exchange Order Time - The time when the order was received by the exchange.       |
| exch\_trade\_time      | Exchange Trade Time - The time when the trade was executed on the exchange.       |
| last\_updated\_time    | Last Updated Time - The last time the order details were updated.                 |
| order\_no              | Order Number - Unique identifier for the order.                                   |
| exch\_order\_no        | Exchange Order Number - Unique identifier for the order assigned by the exchange. |
| exchange               | Exchange - The exchange where the order is placed (e.g., NSE, BSE).               |
| txn\_type              | Transaction Type - Type of transaction (e.g., Buy, Sell).                         |
| segment                | Segment - The segment of the market (e.g., Equity, Derivatives).                  |
| order\_type            | Order Type - Type of order (e.g., Limit, Market, Stop Loss).                      |
| symbol                 | Symbol - The trading symbol of the security.                                      |
| product                | Product - Type of product (e.g., Cash, Margin).                                   |
| product\_name          | Product Name - Name of the product.                                               |
| quantity               | Quantity - The number of shares or contracts.                                     |
| traded\_price          | Trade Price - The price at which the trade was executed.                          |
| trade\_value           | Trade Value - The total value of the trade.                                       |
| trade\_no              | Trade Number - Unique identifier for the trade.                                   |
| security\_id           | Security Id - Identifier for the security being traded.                           |
| pan\_no                | PAN Number - Permanent Account Number of the client.                              |
| participant\_type      | Participant Type - Type of participant (e.g., Client, Dealer).                    |
| mkt\_pro\_flag         | Market Protection Flag - Indicator for market protection.                         |
| mkt\_pro\_value        | Market Protection Value - Value associated with market protection.                |
| settlor                | Settlor - The entity responsible for settlement.                                  |
| encash\_flag           | Encash Flag - Indicator if the encashment is allowed.                             |
| mkt\_type              | Market Type - Type of market (e.g., Normal, Odd Lot, Auction).                    |
| strike\_price          | Strike Price - The strike price for options.                                      |
| expiry\_date           | Expiry Date - The expiry date for derivatives.                                    |
| opt\_type              | Option Type - The type of option (e.g., Call, Put).                               |
| instrument             | Instrument Name - Name of the financial instrument.                               |
| lot\_size              | Lot Size - The lot size for the instrument.                                       |
| series                 | Series - Series of the security (e.g., EQ for equities).                          |
| isin                   | ISIN Code - International Securities Identification Number.                       |
| display\_name          | Custom Symbol Name - Custom name for the symbol.                                  |
| exchange\_inst\_name   | Instrument Name - Name of the instrument on the exchange.                         |
| placed\_by             | Placed By - The entity or person who placed the order.                            |
| placed\_by\_entity\_id | Placed By Entity Id - Identifier for the entity that placed the order.            |
