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
| Header | Type | Required | Description | Example/ENUM |
|---|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication | Bearer access_token |
| x-api-key | string | Yes | API key for access control | x-api-key |
| Content-Type | string | Yes | Format of the request body | application/json |
📦Request Body Schema
| Field | Type | Required | Description | Example/ENUM |
|---|---|---|---|---|
| NoOfLegs | integer | Yes | Number of legs in the order (positive integer) | 1, 2, 3 |
| Mode | string | Yes | Mode of margin calculation: N = New order, M = Modify order | "N", "M" |
| FETraceId | string | No | Echo-back request ID for tracking | "abc123" |
| MessageType | string | Yes | Type of margin request: FUND_UTIL_CALC_REQ for span margin, FUND_BASKET_UTIL_REQ for order cart | "FUND_UTIL_CALC_REQ" |
| LegDetails | array of object | Yes | Array of leg-specific order margin details (see below) | See below tabe |
🗂️Leg Details object Fields
| Field | Type | Required | Description | Example/ENUM |
|---|---|---|---|---|
| LegNo | integer | Yes | Leg number (positive integer) | 1, 2 |
| BuyOrSell | integer | Yes | Transaction type: 1 = Buy, 2 = Sell | 1 |
| MarketSegment | string | Yes | Exchange segments | "NSE_EQ" |
| Token | integer | Yes | Scrip token ID as per exchange master file (positive integer) | 12345 |
| Quantity | integer | Yes | Order quantity (positive integer) | 100 |
| Price | integer | Yes | Price in paise (1 INR = 100 paise), e.g. 100.05 INR = 10005 paise | 10005 |
| MktFlag | integer | No | Market order flag Possible values: 0 = No, 1 = Yes | 0 |
| OldPrice | integer | No | Previous price in paise (before modification) | 9500 |
| OldQuantity | integer | No | Previous quantity (before modification) | 50 |
| ProductType | string | Yes | Product type of the order | "MTF" |
| LegIndicator | integer | No | Custom indicator per leg | 1 |
🟢Success Response - 200 Ok
| Field | Type | Description | Example/ENUM |
|---|---|---|---|
| status | string | Status of the API call | "success" |
| code | string | Response code | "s-101" |
| message | string | Success message | "Success" |
| data | object | Contains margin response details | See details below |
📝Data Object Fields
| Field | Type | Description | Example/ENUM |
|---|---|---|---|
| status | integer | Status code for margin request | 0 |
| result | object | Detailed margin information | See Result object schema |
📘Result object schema
| Field | Type | Description | Example/ENUM |
|---|---|---|---|
| MarketSegmentId | string | Exchange segment ID | "521" |
| Token | string | Scrip token | "12345" |
| ApproxMargin | string | Approximate margin required | "985.75" |
| AvailableMargin | string | Available margin balance | "15000" |
| RequestTraceId | string | Echo-back request ID | "abc123" |
| ProductType | string | Product type | "1" |
| ShortFall | string | Margin shortfall (if any) | "0" |
| Brokerage | string | Estimated 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