Margin Details
This API provides the functionality to retrieve the margin for an instrument. It accepts input parameters like the instrument, quantity, transaction_type and product.
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Content-Type | true | string | Indicates the media type of the resource, set as application/json . |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Request Body
{
"instruments": [
{
"instrument_key": "NSE_EQ|INE669E01016",
"quantity": 1,
"transaction_type": "BUY",
"product": "D",
"price": 16.8
}
]
}
Name | Required | Type | Description |
---|---|---|---|
instruments | true | array | Request instruments for margin details. |
instruments[].instrument_key | true | string | Key of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
instruments[].quantity | true | integer (int32) | Quantity with which the order is to be placed. It should be multiple of lot size. |
instruments[].product | true | string | Product with which the order is to be placed. Possible values: I , D , CO , MTF . |
instruments[].transaction_type | true | string | Indicates whether its a buy or sell order. Possible values: BUY , SELL . |
instruments[].price | false | number (float) | Price with which the order is to be placed |
Responses
- 200
- 4XX
Response Body
- EQ
- Futures
- Options
- MCX
- Currency
{
"status": "success",
"data": {
"margins": [
{
"span_margin": 0,
"exposure_margin": 0,
"equity_margin": 33.6,
"net_buy_premium": 0,
"additional_margin": 0,
"total_margin": 33.6,
"tender_margin": 0
}
],
"required_margin": 33.6,
"final_margin": 33.6
}
}
{
"status": "success",
"data": {
"margins": [
{
"span_margin": 57501.5,
"exposure_margin": 12320.55,
"equity_margin": 0,
"net_buy_premium": 0,
"additional_margin": 0,
"total_margin": 69822.05,
"tender_margin": 0
}
],
"required_margin": 69822.05,
"final_margin": 69822.05
}
}
{
"status": "success",
"data": {
"margins": [
{
"span_margin": 0,
"exposure_margin": 0,
"equity_margin": 0,
"net_buy_premium": 1950,
"additional_margin": 0,
"total_margin": 1950,
"tender_margin": 0
}
],
"required_margin": 1950,
"final_margin": 1950
}
}
{
"status": "success",
"data": {
"margins": [
{
"span_margin": 436,
"exposure_margin": 91.5,
"equity_margin": 0,
"net_buy_premium": 0,
"additional_margin": 146.4,
"total_margin": 673.9,
"tender_margin": 0
}
],
"required_margin": 673.9,
"final_margin": 673.9
}
}
{
"status": "success",
"data": {
"margins": [
{
"span_margin": 1257.32,
"exposure_margin": 418.01,
"equity_margin": 0,
"net_buy_premium": 0,
"additional_margin": 0,
"total_margin": 1675.33,
"tender_margin": 0
}
],
"required_margin": 1675.3325,
"final_margin": 1675.3325
}
}
Field Description
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Typically success for successful operations. |
data | object | Response data for margin |
data.required_margin | float | Total margin required to execute the orders. |
data.final_margin | float | Total margin after margin benefit. |
data.margins | array | Response data for instrument margin. details. |
data.margins[].equity_margin | float | Margin applicable for any equity trades |
data.margins[].total_margin | float | Total margin required for the basket. It will be applicable for all the segments. |
data.margins[].exposure_margin | float | Exposure margin - Based on ELM percentage values provided by exchange. It will be applicable only on FNO trades. |
data.margins[].tender_margin | float | Tender margin - It is applicable as the futures contract approaches its expiration date. |
data.margins[].span_margin | float | Span Margin - Upfront margin mandatory by exchange for derivatives trade. It will be applicable only on FNO trades. |
data.margins[].net_buy_premium | float | Net Buy Premium - Option premium required. |
data.margins[].additional_margin | float | Additional margin - Application margin applicable on MCX FNO trade for certain commodities. |
Error codes
Error code | Description |
---|---|
UDAPI1054 | The product is invalid - The provided value for product is not acceptable |
UDAPI1057 | The transaction_type is invalid - The given value for transaction_type is not valid |
UDAPI1095 | Price must be greater than zero - Please provide a valid price field |
UDAPI1096 | Quantity cannot be less than or equal to zero - The quantity field needs to be greater than zero |
UDAPI1097 | The quantity is required - The quantity field needs to be provided |
UDAPI1098 | Instrument invalid format - The instrument_token is of invalid format |
UDAPI1099 | Instrument key is required - The instrument key is missing |
UDAPI1100 | The product is required - The product is missing |
UDAPI1101 | The transaction_type is required - The transaction_type is missing |
UDAPI1102 | The instrument limit has been exceeded - 20 instruments at a time are allowed in a single request |
UDAPI1103 | Instrument key cannot be duplicated - Same instrument key cannot be repeated |
NOTE
- Margin fields that are not applicable will be set to zero for a given instrument.
- A maximum of 20 instruments is allowed per request
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.
Loading...