Basket Margin
/NorenWClientAPI/GetBasketMarginAuthorization token is required. Enter your access_token from GenAcsTok above.
"Use proxy" sends this request through this website's server, which never logs request or response bodies. Infinn sees the docs server's IP, not yours. Turn it off to send directly from your browser instead.
jData fields
Values are sent as a JSON string in the jData form field.
Logged in User Id
- Example:
YOUR_USER_ID - Where to get it: The ID you log in with at trade.infinn.in (User ID = Client ID). Also returned as uid by GenAcsTok.
Login users account ID
- Example:
YOUR_USER_ID - Where to get it: Same as User ID for individual accounts. Returned by GenAcsTok / UserDetails.
Exchange (Select from ‘exarr’ Array provided in User Details response)
- Example:
NSE - Where to get it: 'exarr' array in the UserDetails response.
- Allowed: NSE, NFO, BSE, MCX, CDS, NCX, BFO, BCD
Unique id of contract on which order to be placed. (use url encoding to avoid special char error for symbols like M&M)
- Example:
RELIANCE-EQ - Where to get it: SearchScrip reply, or the TradingSymbol column of the exchange symbol file.
Order Quantity
- Example:
1 - Where to get it: Quantity in units (for F&O a multiple of the lot size).
Order Price
- Example:
1000 - Where to get it: Your limit price. Use "0" for MKT / SL-MKT orders.
Only to be sent in case of SL / SL-M order.
- Example:
995 - Where to get it: Trigger price, only for SL-LMT / SL-MKT orders.
Product name (Select from ‘prarr’ Array provided in User Details response, and if same is allowed for selected, exchange. Show product display name, for user to select, and send corresponding prd in API call)
- Example:
C - Allowed: C = Delivery, M = Margin, H = Cover, I = Intraday, B = Bracket, F = MTF, S = Special, P = Special2
B -> BUY, S -> SELL
- Example:
B - Allowed: B = buy, S = sell
LMT / MKT / SL-LMT / SL-MKT
- Example:
LMT - Allowed: LMT, MKT, SL-LMT, SL-MKT, DS, 2L, 3L
Book loss Price applicable only if product is selected as H and B (High Leverage and Bracket order)
Optional field. Application only for modify order, open order quantity
Optional field. Application only for modify order, quantity already filled.
Optional field. Application only for modify order, open order price
Optional field. Application only for modify order, open order trigger price
Optional field. Application only for H or B order modification
- Example:
24010100000001 - Where to get it: norenordno returned by PlaceOrder, or listed in the OrderBook.
Optional field. Application only for H or B order modification
Optional field. Array of json objects. (object fields given in below table)
Authorization Token
Required for all API calls. Use the access_token from the GenAcsTok response as a Bearer token.
⚠ When "Use proxy" is on, this token is sent through this website's server on its way to Infinn. It is never logged here, but if you would rather it never leave your browser, turn off "Use proxy" above or use the ready code with your own client instead.
Request to be POSTed to url : /NorenWClientAPI/GetBasketMargin
Request Details
| Parameter Name | Possible value | Description |
|---|---|---|
| jData* | Should send json object with fields in below list | |
| Authorization* | Bearer <access_token> | access_token from GenAcsTok response. Required for all API calls. |
| Json Fields | Possible value | Description |
|---|---|---|
| uid* | Logged in User Id | |
| actid* | Login users account ID | |
| exch* | NSE / NFO / BSE / MCX | Exchange (Select from ‘exarr’ Array provided in User Details response) |
| tsym* | Unique id of contract on which order to be placed. (use url encoding to avoid special char error for symbols like M&M) | |
| qty* | Order Quantity | |
| prc* | Order Price | |
| trgprc | Only to be sent in case of SL / SL-M order. | |
| prd* | C / M / H | Product name (Select from ‘prarr’ Array provided in User Details response, and if same is allowed for selected, exchange. Show product display name, for user to select, and send corresponding prd in API call) |
| trantype* | B / S | B -> BUY, S -> SELL |
| prctyp* | LMT / MKT / SL-LMT / SL-MKT | |
| blprc | Book loss Price applicable only if product is selected as H and B (High Leverage and Bracket order) | |
| rorgqty | Optional field. Application only for modify order, open order quantity | |
| fillshares | Optional field. Application only for modify order, quantity already filled. | |
| rorgprc | Optional field. Application only for modify order, open order price | |
| orgtrgprc | Optional field. Application only for modify order, open order trigger price | |
| norenordno | Optional field. Application only for H or B order modification | |
| snonum | Optional field. Application only for H or B order modification | |
| basketlists | Optional field. Array of json objects. (object fields given in below table) |
Note
Out of basketlists, the parameter provided will be considered as the first order.
| Json Fields of object in values Array | Possible value | Description |
|---|---|---|
| exch* | NSE / NFO / BSE / MCX | Exchange (Select from ‘exarr’ Array provided in User Details response) |
| tsym* | Unique id of contract on which order to be placed. (use url encoding to avoid special char error for symbols like M&M) | |
| qty* | Order Quantity | |
| prc* | Order Price | |
| trgprc | Only to be sent in case of SL / SL-M order. | |
| prd* | C / M / H | Product name (Select from ‘prarr’ Array provided in User Details response, and if same is allowed for selected, exchange. Show product display name, for user to select, and send corresponding prd in API call) |
| trantype* | B / S | B -> BUY, S -> SELL |
| prctyp* | LMT / MKT / SL-LMT / SL-MKT |
Response Details
Response data will be in json format with below fields:
| Json Fields | Possible value | Description |
|---|---|---|
| stat | Ok or Not_Ok | Place order success or failure indication. |
| request_time | Response received time. | |
| remarks | This field will contain rejection reason. | |
| marginused | Total margin used. | |
| marginusedtrade | Margin used after trade. | |
| emsg | This will be present only if Order placement fails |
Calculation
The /Limits API must be called first in order to calculate the post-trade margin and basket margin. Here, the marginused in the Limits API response will be [marginused(Limits)].
-
Not Ticked - Include Existing Margin:
- Post-trade margin =
marginusedtrade(GetBasketMargin)-marginused(Limits) - Basket margin =
marginused(GetBasketMargin)-marginused(Limits)
- Post-trade margin =
-
Ticked - Include Existing Margin:
- Post-trade margin =
marginusedtrade(GetBasketMargin) - Basket margin =
marginused(GetBasketMargin)
- Post-trade margin =
curl --request POST \
--url 'https://api.infinn.in/NorenWClientAPI/GetBasketMargin' \
--header 'Authorization: Bearer PASTE_ACCESS_TOKEN_HERE' \
--header 'Content-Type: text/plain' \
--data 'jData={"uid":"YOUR_USER_ID","actid":"YOUR_USER_ID","exch":"NSE","tsym":"RELIANCE-EQ","qty":"1","prc":"1000","prd":"C","trantype":"B","prctyp":"LMT"}'