Trading APIs

Positions

Purpose

This method will provide the client’s Positions

Request URL https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/NetPositionNetWise

Request Method POST
Request format: JSON

Request Header Content-Type:application/json

Request Body

Header

Field Name Description Data Type (max length) Validation Sample Value
appName App Name provided at the time of registration String Cannot be empty. APPTRIAL
appVer Developer App Version String Cannot be empty. 1.0
key UserKey generated at the time of registration String Cannot be empty. ue73jHVeEzBswG5ss9ugyrAasdasdyKYxg
osName Channel of order String Cannot be Empty WEB, Android, iOS
requestCode Request Code of the API called String Cannot be Empty 5PNPNWV1
userId User ID generated at the time of registration String Cannot be empty. asdue73jHVeE
password Password generated at the time of registration String Cannot be empty. 9ugyrAasdasdy

Body

Field Name Description Data Type (max length) Validation Sample Value
ClientCode Pass the registered client code of the user. String(10) Cannot be empty. 12345678

Response Body

Field Name Description Data Type (Max length) List Values Sample Value
Message If error code is not 0 then use the message field otherwise it will be empty. String A. "Invalid head parameters."
B. "Invalid Body Parameters."
C. “Success”
D. “Error while processing your request.”
Success
Status If Error code is not 0 then there is an issue while processing client request, In such a case use Message field only. Integer A. -1 = Exception
B. 0 = success
C. 1=No Record Found
D. 2- Invalid Input/ head parameters
0
NetPositionDetail This class contain the all Net Postion details of Client List - -

NetPositionDetail

FieldName Type Description
Exch Char Exchange in which order has been Placed. N- NSE, B-BSE, M-MCX
ExchType Char Exchange segment C-Cash, D-Derivatives, U-Currency
ScripCode Int32 Scrip Code of the particular stock
ScripName String Scrip Name of the scrip.
BuyQty Int32 Number of Shares bought in particular scrip.
BuyAvgRate Double Average buying rate for a particular scrip
BuyValue Double Average buying rate Multiply by bought quantity
SellQty Int32 Number of shares sold in particular scrip.
SellAvgRate Double Average Selling Rate.
SellValue Double Average Selling rate Multiply by sold quantity.
NetQty Int32 Bought Quantity – sold Quantity.
BookedPL Double Profit or Loss booked by client for particular scrip.
LTP Double Last traded Price.
OrderFor Char I-Intraday , D- Delivery.
Multiplier Double Scrip multiplier
BodQty Int32 Bod quantity
MTOM Double MTOM profit and loss.
PreviousClose Double Previous close

Sample Request

{
"head": {
        "appName": "APPTRIAL",
        "appVer": "1.0",
        "key": "ue73jH6AKVASDSD34RXeEzBswG5ss9ugyrAyKYxg",
        "osName": "Android",
        "requestCode": "5PNPNWV1",
        "userId": "s9RQWE22BzKCjdL9N",
        "password": "nnS4f34HY775zw"
        },
"body": {
        "ClientCode": "12345678"
        }
}

Sample Response

{
    "body": {
            "Message": "",
            "NetPositionDetail": [
            {
            "BodQty": 0,
            "BookedPL": 0,
            "BuyAvgRate": 0,
            "BuyQty": 0,
            "BuyValue": 0,
            "Exch": "N",
            "ExchType": "C",
            "LTP": 52.75,
            "MTOM": 0.15,
            "Multiplier": 1,
            "NetQty": -1,
            "OrderFor": "D",
            "PreviousClose": 52.1,
            "ScripCode": 11184,
            "ScripName": "IDFCFIRSTB",
            "SellAvgRate": 52.9,
            "SellQty": 1,
            "SellValue": 52.9
            }
            ],
            "Status": 0
            },
    "head": {
            "responseCode": "5PNPNWV1",
            "status": "0",
            "statusDescription": "Success"
            }
}