Skip to content

Product Conversion

Position conversion is the process of converting the Intraday position to overnight and the overnight position to Intraday

POST: /api/productConversion

https://connect.thefirstock.com/api/productConversion

Request Details

Parameter Description
exchange Exchange
quantity Quantity to be converted.
userId User id of the logged in user.
actid Account id
product C / M / I Product to which the user wants to convert position.
previousProduct C / M / I Original product of the position.
transactionType B / S B -> BUY, S -> SELL
positionType Day / CF Converting Day or Carry forward position
jKey Key Obtained on login success.
tradingSymbol Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO.

Code

from thefirstock import thefirstock

PC = thefirstock.firstock_ConvertProduct(
    exchange="NFO",
    tradingSymbol="BANKNIFTY28APR22C37400",
    quantity="250",
    product="I",
    previousProduct="M",
    transactionType="B",
    positionType="CF"
)
curl -X POST 'https://connect.thefirstock.com/api/productConversion' \
-H 'Content-Type: application/json' \
-d '{
    "userId": "",
    "actid": "",
    "exchange": "NSE",
    "tradingSymbol": "ITC-EQ",
    "quantity": "10",
    "product": "C",
    "transactionType": "B",
    "positionType": "LMT",
    "previousProduct": "DAY",
    "jKey": ""
}'
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.productConversion({
    exchange: "",
    tradingSymbol: "",
    quantity: "",
    product: "",
    previousProduct: "",
    transactionType: "",
    positionType: ""
}, (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: "BANKNIFTY28APR22C37400",
       quantity: "250",
       product: "I",
       previousProduct: "M",
       transactionType: "B",
       positionType: "CF"
        );
}
}

Response Details

Parameter Description
stat Ok or Not_Ok Place order success or failure indication
emsg This will be present only if Order cancelation fails
requestTime Response received time.

Sample Response

{
"request_time":"23:59:20 29-05-2022",
"stat":"Ok",
}    
{
"stat":"Not_Ok",
"emsg": "Invalid Input : Invalid Position Type"
}