Net-wise Position

POSTJSONRest API
2901

Daily API Calls

100%

Success Rate

62 ms

Avg. Response Time


NetPosition API provides Open Positions in Derivates contracts and Intraday Stock positions.  

Overnight Derivative positions can be identified with BodQty flag. While overnigh stock positions will not appear as it will be converted to holding.

REQUEST URL

https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V2/NetPositionNetWise

Request headers

KEYVALUE

Content-Type

application/json

Authorization

bearer{Your Access Token}

Request body

FIELD NAMEMANDATORYDESCRIPTION

head

key

STRING

Yes

AppKey of user or partner. 

body

Clientcode

STRING

Yes

5paisa demat account client code of the user in plain text.

SAMPLE REQUEST BODY  :

{
    "head": {
        "key": "{{vendor_key}}"
    },
    "body": {
        "ClientCode": "{{clientcode}}"
    }
}

Response body

FIELD NAMEVALUESDESCRIPTION

head

responseCode

STRING

5PNPNWV2

This is the unique response code for the API.

status

STRING

0: Success

2: Invalid head parameters.

 

This is the status code which depicts the status of API request to the server.

statusDescription

STRING

Success

Invalid head parameters.

This is the description of the status received from the server for the API request.

body

NetPositionDetail

ARRAY

 

It provides the list of all stocks available in user's IIFL Securities account positions for the day along with holdings as beginning of the day.

Status

INTEGER

0: Success

1: No record found

9: Invalid Session

This is the numeric code
for the status of API 
request

 

Message

STRING

Success

No record found

Invalid Session

This is the description of the status of API request.

NetPositionDetail

FIELD NAMEVALUESDESCRIPTION

BODPositionPrice

DOUBLE

-

This is the price of the instrument in positions as beginning of the day.

BodQty

INTEGER

-

This is total quantity of the instrument in positions as beginning of the day.

BookedPL

DOUBLE

-

Total profit or loss booked for the day by the user through the instrument.

BuyAvgRate

DOUBLE

-

This is the average rate at which instrument is bought on the day.

BuyQty

INTEGER

-

This is total quantity of the instrument bought on the day.

BuyValue

DOUBLE

-

It is total value of the instrument bought on the day.

Exch

STRING

N: NSE
B: BSE
M: MCX
N: NCDEX (for exchange type = ‘X’)

This is the exchange in which position is available.

ExchType

STRING

C: Cash
D: Derivatives (NSE, BSE & MCX F&O)
U: Currency
Y: NSE & BSE Commodities
X: NCDEX Commodities

This is exchange type in which the position is available.

LTP

DOUBLE

-

This is last traded price for the instrument for the time request is sent.

MTOM

DOUBLE

-

This is the market-to-market profit or loss from the position.

Multiplier

INTEGER

-

This is multiplier of quantity used while calculating profit or loss.

NetQty

INTEGER

-

This is the net quantity of the position.

OrderFor

STRING

D: Delivery
I: Intraday
S: Bracket Order
C: Cover Order

This is the type of the position.

PreviousClose

DOUBLE

-

This is closing price of the previous trading day for the instrument.

ScripCode

INTEGER

-

This is unique code for the instrument.

ScripName

STRING

-

This is the name of the instrument in the position.

SellAvgRate

DOUBLE

-

This is average rate for selling the instrument on the day.

SellQty

INTEGER

-

This is the total quantity of the instrument sold on the day.

SellValue

DOUBLE

-

This is total value of the instrument sold.

 SAMPLE SUCCESS RESPONSE  
{
    "body": {
        "Message": "",
        "NetPositionDetail": [
            {
                "BODPositionPrice": 809.2514,
                "BodQty": 5,
                "BookedPL": 0,
                "BuyAvgRate": 0,
                "BuyQty": 0,
                "BuyValue": 0,
                "Exch": "N",
                "ExchType": "C",
                "LTP": 818.6,
                "MTOM": 46.743,
                "Multiplier": 1,
                "NetQty": 5,
                "OrderFor": "D",
                "PreviousClose": 814.6,
                "ScripCode": 4963,
                "ScripName": "ICICIBANK",
                "SellAvgRate": 0,
                "SellQty": 0,
                "SellValue": 0
            },
            {
                "BODPositionPrice": 91.1505,
                "BodQty": 0,
                "BookedPL": 0,
                "BuyAvgRate": 0,
                "BuyQty": 0,
                "BuyValue": 0,
                "Exch": "N",
                "ExchType": "C",
                "LTP": 107.6,
                "MTOM": 0,
                "Multiplier": 1,
                "NetQty": 0,
                "OrderFor": "D",
                "PreviousClose": 100.35,
                "ScripCode": 3499,
                "ScripName": "TATASTEEL",
                "SellAvgRate": 0,
                "SellQty": 0,
                "SellValue": 0
            }
        ],
        "Status": 0
    },
    "head": {
        "responseCode": "IIFLMarRQNPNWV2",
        "status": "0",
        "statusDescription": "Success"
    }
}
 SAMPLE FAILURE RESPONSE  Failure due to incorrect client code or IIFLMarcookie
{
    "body": {
        "Message": "Invalid Session",
        "NetPositionDetail": [],
        "Status": 9
    },
    "head": {
        "responseCode": "IIFLMarRQNPNWV2",
        "status": "0",
        "statusDescription": "Invalid Session"
    }
}
 SAMPLE FAILURE RESPONSE  Failure when head parameters are wrong
{
    "body": null,
    "head": {
        "responseCode": "IIFLMarRQNPNWV2",
        "status": "2",
        "statusDescription": "Invalid head parameters."
    }
}
On this Page

Knowledge base

building the product with optimized integration
Integration Tips
how to use this API that suits your work flow best
Start using our APIs

Contribute and get rewarded

Help make these Dev Docs great, contribute to the APIs and get rewarded for your contribution

Need Help

Ask Developer Community

Contact Support

 

Changelog

Changes made to our APIs - Changelog

AVENUES