Skip to main content

GET ORDER MARGIN INFO​

This API allows you to fetch the required margin information for placing or modifying an order.

It helps users understand approximate margin requirements, available margin, and shortfall before executing trades.

🔑 Header Parameters​

HeaderTypeDescriptionExample
Content-TypestringSpecifies the media type of the requestapplication/json
AuthorizationstringAccess token for authenticated requests{{access_token}}
x-api-keystringAPI key used to authorize the request{{x-api-key}}

📑 Request Body Parameters​

FieldTypeRequiredDescriptionExample
client_idstringNoClient ID for margin calculation"CL12345"
NoOfLegsintegerYesNumber of legs in the order1
ModestringYesMode (N = New order, M = Modify order)"N"
FETraceIdstringNoEcho-back request identifier"TRACE123"
LegDetailsarrayYesDetails of order legsRefer below

📦 Leg Details Object​

FieldTypeRequiredDescriptionExample / Enum
LegNointegerYesLeg number1
BuyOrSellintegerYesTransaction type (1 = BUY, 2 = SELL)1
MarketSegmentIdintegerYesExchange segment ID1
TokenintegerYesScrip token12345
QuantityintegerYesOrder quantity10
PriceintegerYesPrice (in paise)10050
MktFlagintegerNoMarket order flag (0 = Limit, 1 = Market)0
OldPriceintegerNoPrevious price (for modification)10000
OldQuantityintegerNoPrevious quantity (for modification)5
ProductTypestringYesProduct type"M"
LegIndicatorintegerNoLeg indicator0

🟢 Success Response - 200 OK​

Content-Type: application/json

FieldTypeDescriptionExample
statusstringStatus of API call"success"
codestringResponse code to user request"s-101"
messagestringSuccess message"Margin calculated successfully"
dataobjectMargin response payloadRefer to Data Object Fields

📦 Data Object Fields​

FieldTypeDescriptionExample
statusintegerStatus code of margin request1
resultobjectMargin calculation resultRefer below

📘 Result Object Fields​

FieldTypeDescriptionExample
MarketSegmentIdstringExchange segment ID"1"
TokenstringScrip token"12345"
ApproxMarginstringApproximate margin required"5000"
AvailableMarginstringAvailable margin"10000"
RequestTraceIdstringEcho-back request ID"TRACE123"
ProductTypestringProduct type"M"
ShortFallstringMargin shortfall (if any)"0"
BrokeragestringBrokerage charges"10"