Skip to main content

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

ParameterDescriptionData typesExample
exchangeExchangeString"NFO"
quantityQuantity to be converted.String"250"
userIdUser id of the logged in user.String"AA1999"
productC / M / I Product to which the user wants to convert position.String"I"
previousProductC / M / I Original product of the position.String"M"
transactionTypeB / S B -> BUY, S -> SELLString"B"
positionTypeDay / CF Converting day or carry forward positionString"CF"
jKeyKey Obtained on login success.String"d9b4e1b1c79042476fd96
11eed81003b2dc34c3f13b
0b60a4842fd5a24c9f3f2"
tradingSymbolTrading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO.String"NIFTY"
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"
}

Success response details

ParameterDescriptionData typesExamples
StatusSuccessString"Success"
data.statusOkString"ok"
data.requestTimeResponse received time.String"17:38:34 17-02-2023"

Failure response details

ParameterDescriptionData TypeExample
statusFailedString"Failed"
codeHTTP CodeString"404"
nameType of errorString"ORDERS_NOT_FOUND"
error.fieldError fieldString"orderDetails"
error.messageError messageString"No data on the orders was found"

Sample response

{
"Status": "Success",
"data": {
"requestTime": " "17:38:34 17-02-2023"",
"status": "ok"
}
}