Skip to content

Order Margin

You can view the margin requirement for the selected order before placing the order.


POST: /apiV2/orderMargin

https://connect.thefirstock.com/apiV2/orderMargin

Request Details

Parameter Description
userId User Id of the login user
exchange NSE / NFO / BSE
tradingSymbol Trading Symbol (use url encoding to avoid special char error for symbols like M&M)
quantity Order Quantity
price Order Price
jKey Key Obtained on login success.
product C/M/I C -> Cash and Carry, M -> F&O Normal, I -> Intraday
transactionType B/S B -> BUY, S -> SELL
priceType LMT / MKT / SL-LMT / SL-MKT

Code

curl --X POST 'https://connect.thefirstock.com/apiV2/orderMargin' \
--H 'Content-Type: application/json' \
--d '{
    "userId": "",
    "exchange": "",
    "tradingSymbol": "",
    "quantity": "",
    "price": "",
    "product": "",
    "transactionType": "",
    "priceType": "",
    "jKey": ""
}'
from thefirstock import thefirstock

orderMargin = firstock_orderMargin(
    exchange="",
    tradingSymbol="",
    quantity="",
    priceType="",
    product="",
    price="",
    transactionType=""
)
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.orderMargin({
    exchange:"",
    tradingSymbol:"",
    quantity:"",
    price:"",
    product:"",
    transactionType:"",
    priceType:"",
},(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.orderMargin(
        exchange: "NSE",
        tradingSymbol: "ITC-EQ",
        quantity: "10",
        price: "260",
        product: "C",
        transactionType: "B",
        priceType: "LMT"
      );
}
}

Success Response Details

Parameter Description
data.requestTime Response received time.
Status Success
data.cash This data to be sent in subsequent requests in jKey field and web socket connection while connecting.
data.marginused Email Id
data.remarks This field will be available only on success.

Failure Response Details

Parameter Description
Status Failed
data Type of error
{
"Status": "Success",
"data": {
    "requestTime": "",
    "cash": "",
    "marginused": "",
    "remarks": ""
    }
}
{
  "Status": "Failed",
  "data": "Invalid Input :   is Invalid product."
}