GET ORDER MARGIN INFO API
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 | Type | Description | Example |
|---|
| Content-Type | string | Specifies the media type of the request | application/json |
| Authorization | string | Access token for authenticated requests | {{access_token}} |
| x-api-key | string | API key used to authorize the request | {{x-api-key}} |
📑 Request Body Parameters
| Field | Type | Required | Description | Example |
|---|
| client_id | string | No | Client ID for margin calculation | "CL12345" |
| NoOfLegs | integer | Yes | Number of legs in the order | 1 |
| Mode | string | Yes | Mode (N = New order, M = Modify order) | "N" |
| FETraceId | string | No | Echo-back request identifier | "TRACE123" |
| LegDetails | array | Yes | Details of order legs | Refer below |
📦 Leg Details Object
| Field | Type | Required | Description | Example / Enum |
|---|
| LegNo | integer | Yes | Leg number | 1 |
| BuyOrSell | integer | Yes | Transaction type (1 = BUY, 2 = SELL) | 1 |
| MarketSegmentId | integer | Yes | Exchange segment ID | 1 |
| Token | integer | Yes | Scrip token | 12345 |
| Quantity | integer | Yes | Order quantity | 10 |
| Price | integer | Yes | Price (in paise) | 10050 |
| MktFlag | integer | No | Market order flag (0 = Limit, 1 = Market) | 0 |
| OldPrice | integer | No | Previous price (for modification) | 10000 |
| OldQuantity | integer | No | Previous quantity (for modification) | 5 |
| ProductType | string | Yes | Product type | "M" |
| LegIndicator | integer | No | Leg indicator | 0 |
🟢 Success Response - 200 OK
Content-Type: application/json
| Field | Type | Description | Example |
|---|
| status | string | Status of API call | "success" |
| code | string | Response code to user request | "s-101" |
| message | string | Success message | "Margin calculated successfully" |
| data | object | Margin response payload | Refer to Data Object Fields |
📦 Data Object Fields
| Field | Type | Description | Example |
|---|
| status | integer | Status code of margin request | 1 |
| result | object | Margin calculation result | Refer below |
📘 Result Object Fields
| Field | Type | Description | Example |
|---|
| MarketSegmentId | string | Exchange segment ID | "1" |
| Token | string | Scrip token | "12345" |
| ApproxMargin | string | Approximate margin required | "5000" |
| AvailableMargin | string | Available margin | "10000" |
| RequestTraceId | string | Echo-back request ID | "TRACE123" |
| ProductType | string | Product type | "M" |
| ShortFall | string | Margin shortfall (if any) | "0" |
| Brokerage | string | Brokerage charges | "10" |