Skip to main content

Get Order Margin Info

This API is used to fetch margin requirement details for a new or modified order. It supports multi-leg strategies (1 to 3+ legs), different product types, and market segments.

🔑Header Parameters

HeaderTypeRequiredDescriptionExample/ENUM
AuthorizationstringYesBearer token for authenticationBearer access_token
x-api-keystringYesAPI key for access controlx-api-key
Content-TypestringYesFormat of the request bodyapplication/json

📦Request Body Schema

FieldTypeRequiredDescriptionExample/ENUM
NoOfLegsintegerYesNumber of legs in the order (positive integer)1, 2, 3
ModestringYesMode of margin calculation: N = New order, M = Modify order"N", "M"
FETraceIdstringNoEcho-back request ID for tracking"abc123"
MessageTypestringYesType of margin request: FUND_UTIL_CALC_REQ for span margin, FUND_BASKET_UTIL_REQ for order cart"FUND_UTIL_CALC_REQ"
LegDetailsarray of objectYesArray of leg-specific order margin details (see below)See below tabe

🗂️Leg Details object Fields

FieldTypeRequiredDescriptionExample/ENUM
LegNointegerYesLeg number (positive integer)1, 2
BuyOrSellintegerYesTransaction type: 1 = Buy, 2 = Sell1
MarketSegmentstringYesExchange segments"NSE_EQ"
TokenintegerYesScrip token ID as per exchange master file (positive integer)12345
QuantityintegerYesOrder quantity (positive integer)100
PriceintegerYesPrice in paise (1 INR = 100 paise), e.g. 100.05 INR = 10005 paise10005
MktFlagintegerNoMarket order flag Possible values: 0 = No, 1 = Yes0
OldPriceintegerNoPrevious price in paise (before modification)9500
OldQuantityintegerNoPrevious quantity (before modification)50
ProductTypestringYesProduct type of the order"MTF"
LegIndicatorintegerNoCustom indicator per leg1

🟢Success Response - 200 Ok

FieldTypeDescriptionExample/ENUM
statusstringStatus of the API call"success"
codestringResponse code"s-101"
messagestringSuccess message"Success"
dataobjectContains margin response detailsSee details below

📝Data Object Fields

FieldTypeDescriptionExample/ENUM
statusintegerStatus code for margin request0
resultobjectDetailed margin informationSee Result object schema

📘Result object schema

FieldTypeDescriptionExample/ENUM
MarketSegmentIdstringExchange segment ID"521"
TokenstringScrip token"12345"
ApproxMarginstringApproximate margin required"985.75"
AvailableMarginstringAvailable margin balance"15000"
RequestTraceIdstringEcho-back request ID"abc123"
ProductTypestringProduct type"1"
ShortFallstringMargin shortfall (if any)"0"
BrokeragestringEstimated brokerage amount"50"

⚠️Notes:

  • Use this API to calculate required margin before placing or modifying an order.
  • Supports multi-leg (e.g., spreads, baskets) and various Product type.
  • Returns margin required, available margin, shortfall, and brokerage.
post/transactional/v1/getOrderMarginInfo