Product conversion
Position conversion is defined as an act of converting trades from their original product type and intent. For instance, if intraday trades are converted to positional carry forward trades, this shall be an act of position conversion and so on.
The conversion of positions involves transforming an Intraday position into an overnight position, and vice versa.
Method: POST
https://connect.thefirstock.com/api/V3/productConversion
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
exchange | Exchange | String | "NFO" |
quantity | Quantity to be converted. | String | "250" |
userId | User id of the logged in user. | String | "AA1999" |
product | C / M / I Product to which the user wants to convert position. | String | "I" |
previousProduct | C / M / I Original product of the position. | String | "M" |
transactionType | B / S B -> BUY, S -> SELL | String | "B" |
positionType | Day / CF Converting day or carry forward position | String | "CF" |
jKey | Key Obtained on login success. | String | "d9b4e1b1c79042476fd96 11eed81003b2dc34c3f13b 0b60a4842fd5a24c9f3f2" |
tradingSymbol | Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO. | String | "NIFTY" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/productConversion' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"product": "C",
"transactionType": "B",
"positionType": "DAY",
"previousProduct": "I",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}
from thefirstock import thefirstock
convertProduct = thefirstock.firstock_ConvertProduct(
transactionType="B",
tradingSymbol="ITC-EQ",
quantity="1",
product="C",
previousProduct="I",
positionType="DAY",
exchange="NSE"
)
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.productConversion(
{
exchange: "NSE",
tradingSymbol: "ITC-EQ",
quantity: "1",
product: "C",
previousProduct: "I",
transactionType: "B",
positionType: "DAY",
},
(err, result) => {
console.log("Error, ", err);
console.log("Result: ", result);
}
);
using thefirstock;
class Program
{
public static void Main()
{
Firstock firstock = new Firstock();
var result = firstock.productConversion(
exchange: "NFO",
tradingSymbol: "ITC-EQ",
quantity: "1",
product: "C",
previousProduct: "I",
transactionType: "B",
positionType: "DAY"
);
}
}
Success response details
Parameter | Description | Data types | Examples |
---|---|---|---|
Status | Success | String | "Success" |
data.status | Ok | String | "ok" |
data.requestTime | Response received time. | String | "17:38:34 17-02-2023" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "404" |
name | Type of error | String | "ORDERS_NOT_FOUND" |
error.field | Error field | String | "orderDetails" |
error.message | Error message | String | "No data on the orders was found" |
Sample response
- Success response
- Failure response
{
"Status": "Success",
"data": {
"requestTime": " "17:38:34 17-02-2023"",
"status": "ok"
}
}
{
"status": "Failed",
"code": "404",
"name": "ORDERS_NOT_FOUND",
"error": {
"field": "orderDetails",
"message": "No data on the orders was found"
}
}