Skip to main content

Basket margin

Required margin is the amount required to place all the orders in the basket of multiple stocks.

Method: POST

https://connect.thefirstock.com/api/V3/basketMargin

Request details

ParameterDescriptionData typesExample
userIdLogged in user IdString"AA1999"
dataNoren order numberListList of data
jKeyKey obtained on login success.String"d1b02fdc270bd03d93926e10633aa00c"

Request details for Data

ParameterDescriptionData typesExample
exchangeNSE / NFO / BSE/ MCXString"NSC"
tradingSymbolUnique id of contract on which
order to be placed. (use urlencoding
to avoid special char error for symbols
like M&M)
String"SAIL01DEC22P99"
quantityOrder quantityString"1"
transactionTypeB -> BUY, S -> SELLString"S"
priceOrder PriceString"260"
productC/M/I C -> Cash and Carry, M -> F&O Normal, I -> IntradayString"C"
priceTypeLMT / MKT / SL-LMT / SL-MKTString"LMT"
curl --location 'https://connect.thefirstock.com/api/V3/basketMargin' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"basket": [
{
"exchange": "NFO",
"tradingSymbol": "NIFTY23FEB23P17000",
"quantity": "50",
"transactionType": "S",
"price": "0",
"product": "M",
"priceType": "LMT"
},
{
"exchange": "NFO",
"tradingSymbol": "NIFTY23FEB23P17000",
"quantity": "50",
"transactionType": "S",
"price": "0",
"product": "M",
"priceType": "LMT"
}
]
}'

Success response details

ParameterDescriptionData typesExamples
statusSuccessString"Success"
data.request_timeResponse received time.String"18:00:27 16-02-2023"
data.remarksThis field will contain rejection reason.String"basketMargin"
data.marginusedTotal margin used.String "19150.45"
data.marginusedtradeMargin used after tradeString"22.95"
data.statThis will be present only if Order placement failsString"ok"

Failure response details

ParameterDescriptionData TypeExample
statusFailedString"Failed"
codeHTTP CodeString"401"
nameType of errorString"INVALID_USERID"
error.fieldError fieldString"userid"
error.messageError messageString"userid parameter is invalid"

Sample response

{
"status": "Success",
"data": {
"request_time": "18:00:27 16-02-2023",
"stat": "Ok",
"marginused": "19150.45",
"marginusedtrade": "22.95",
"remarks": "basketMargin"
}
}