Get Order Margin¶
Use this page to estimate Trading API V3 funds and margin requirements before placing an order.
Estimate funds before placing:
- one single-instrument order
- multiple independent single-instrument orders
- one strategy order
The request payload uses the same Trading API V3 order fields as:
Add only the top-level requestType field for the margin-estimation call.
Endpoint¶
Method: POST
Endpoint: sentinel/orders/funds_required
Basic Usage¶
curl --location 'https://uatapi.nubra.io/sentinel/orders/funds_required' \
--header 'Authorization: Bearer {{session_token}}' \
--header 'x-device-id: {{x_device_id}}' \
--header 'x-app-version: 0.4.5' \
--header 'x-device-os: sdk' \
--header 'Cookie: deviceId={{x_device_id}}' \
--header 'Content-Type: application/json' \
--data '{
"requestType": "NEW",
"orders": [
{
"refId": 72329,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": false,
"executionMode": "ENTRY",
"entryPrice": 127000,
"stratTags": ["rest-api-v3", "single-margin"]
}
]
}'
Example Margin Patterns¶
Single Order¶
{
"requestType": "NEW",
"orders": [
{
"refId": 72329,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": false,
"executionMode": "ENTRY",
"entryPrice": 127000,
"stratTags": ["rest-api-v3", "single-margin"]
}
]
}
Strategy Order¶
Use the same base-quantity model as strategy placement. The top-level qty is the common executable base quantity, and each legs[].unitQty value is the per-leg multiplier.
{
"requestType": "NEW",
"orders": [
{
"isMultiLeg": true,
"qty": 65,
"side": "BUY",
"deliveryType": "CNC",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
"entryPrice": 44935,
"legs": [
{ "refId": 1497712, "unitQty": 1 },
{ "refId": 1497713, "unitQty": 1 }
],
"stratTags": ["rest-api-v3", "strategy-margin"]
}
]
}
This strategy-margin example corresponds to:
- nearest validated expiry:
20260616 - strike:
23600 - CE leg:
1497712 - PE leg:
1497713 - top-level strategy base quantity:
65 - each leg multiplier:
1 - net entry price used in validation:
44935
Request Contract¶
| Field | Type | Required | Meaning |
|---|---|---|---|
requestType |
string | Yes | Use NEW when estimating funds for a new order before placement |
orders |
array | Yes | Trading API V3 order payloads to estimate |
orders[].refId |
int | Conditional | Single-order instrument reference id. Omit for strategy orders |
orders[].qty |
int | Yes | Single-order quantity or the common executable base quantity for a strategy |
orders[].side |
string | Yes | BUY or SELL |
orders[].deliveryType |
string | Yes | IDAY or CNC |
orders[].priceType |
string | Yes | LIMIT or MARKET |
orders[].validityType |
string | Yes | DAY, IOC, or GTE |
orders[].isMultiLeg |
bool | Yes | false for independent orders, true for strategy orders |
orders[].executionMode |
string | Yes | ENTRY, EXIT, or ENTRY_AND_EXIT |
orders[].entryPrice |
int | Conditional | Entry price or strategy net entry price |
orders[].legs |
array | Conditional | Required for strategy-order margin checks |
orders[].legs[].refId |
int | Yes for leg | FNO instrument reference id |
orders[].legs[].unitQty |
int | Yes for leg | Leg multiplier |
Condition Fields¶
| Field | Type | Description |
|---|---|---|
entryConfig.triggers.* |
object | Entry trigger controls |
entryConfig.entryTime |
string | Timed entry |
exitConfig.stoplossParams.* |
object | Stop-loss controls |
exitConfig.targetParams.* |
object | Target controls |
exitConfig.exitTime |
string | Timed exit |
Response Contract¶
The margin response includes both funds and charge information.
Sample output:
totalFundsRequired: 13565marginInfo.totalMargin: 0
This means the selected example produces a charges-only requirement in this sample response, without an additional blocked strategy margin component.
{
"code": 1,
"marginInfo": {
"totalMargin": 0,
"message": null
},
"brokerageInfo": {
"totalChargesFloat": 13565.63879385
},
"totalFundsRequired": 13565,
"willDefaultBePlacedAsAmo": true,
"willBeAutoSliced": false
}
marginInfo¶
| Field | Meaning |
|---|---|
totalMargin |
Final margin component calculated by the engine |
message |
Optional engine message |
brokerageInfo¶
| Field | Meaning |
|---|---|
totalChargesFloat |
Total estimated charges as a float before rounding in the top-level response |
Important Rules¶
- Margin estimation does not place an order. It only evaluates the payload and returns estimated funds and charges.
- For strategy orders, keep
qtyandlegs[].unitQtyaligned with the placement payload you intend to use. - There is no separate basket-level multiplier field in the margin request. Scale the full strategy by changing the top-level base quantity.
- If you want to cross-check the example in the UI, validate the same CE and PE instruments, expiry, strike, side, and net entry price.