Net Position


PURPOSE


This method will provide the client’s Positions in both equity and commodity market across all exchanges and exchange segments. . The only parameter passed on the request is the client’s ID which is passed to the system. This Net position will be for the day based on all orders, trades and will have Buy Quantity along with Buy Value and average buy value, Sell Quantity with sell value, last traded price along with booked PL. The method responds with status of execution of API and a message along with the requisite type of status.

Request Method: POST

Request format: JSON

Request Header:

Content-Type: application/json

Ocp-Apim-Subscription-Key:
to be provided after registration


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. IIFLMarDEMO
appVer Developer App Version String Cannot be empty. 1.0
key UserKey generated at the time of registration String Cannot be empty. ABpyyGUh1nsbesSlup3VKURkI4tQDe8y
osName Channel of order String Cannot be empty. WEB, Android, iOS
requestCode Request Code of the API called String Cannot be empty. IIFLMarRQNetPositionV4
userId User ID generated at the time of registration String Cannot be empty. ZkhghN5uKj
password Password generated at the time of registration String Cannot be empty. lfjnfS7rHGj

BODY

Field Name Description Data Type
(max length)
Validation Sample Value
ClientCode Pass the Clientcode for whome we want to check margin. String(15) Cannot be empty. Dummy123

REQUEST:

{
  "head": {
    "appName": "IIFLMarDEMO",
    "appVer": "1.0",
    "key": "ABpyyGUh1nsbesSlup3VKURkI4tQDe8y",
    "osName": "Android",
    "requestCode": "IIFLMarRQNetPositionV4",
    "userId": "mocZueK622W",
    "password": "UjR1ElLwSzr"
  },
  "body": {
    "ClientCode": "Dummy123"
  }
}

RESPONSE BODY


HEADER

Field Name Description Data Type
(max length)
List of Values Sample Value
responseCode This is the response code of API String - IIFLMarRQLoginForVendor
status This is the response code of API String 0
2
0
statusDescription This is the response code of API String 0 - Success
2 - Invalid head parameters
Success
responseCode This is the response code of API String - IIFLMarRQLoginForVendor

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 -1 = Exception
0 = success
1=No Record Found
2- Invalid Input/ head parameters
0
TimeStamp Returns the server time. DateTime - /Date(1557823383172+0530)/
NetPositionDetail This class contain the all Net Postion details of Client List - -

NET POSITION DETAIL

FieldName Type Description
Exch Char Exchange in which order has been Placed. N- NSE, B-BSE, M-MCX
ExchType Char Exchange segment of the scrip (C-Cash, D-Derivative, 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.
MTOM Double MTOM Profit and Loss

Success Response

{
  "head": {
    "responseCode": "IIFLMarRQNetPositionV4",
    "status": "0",
    "statusDescription": "Success"
  },
  "body": {
    "Message": "",
    "NetPositionDetail": [
      {
        "BookedPL": 0,
        "BuyAvgRate": 1405.06,
        "BuyQty": 10,
        "BuyValue": 14050.6,
        "Exch": "N",
        "ExchType": "C",
        "LTP": 1299,
        "MtoM": -1060.6,
        "Multiplier": 0,
        "NetQty": 10,
        "OrderFor": "D",
        "ScripCode": 2885,
        "ScripName": "RELIANCE",
        "SellAvgRate": 0,
        "SellQty": 0,
        "SellValue": 0
      },
      {
        "BookedPL": -24.4664,
        "BuyAvgRate": 1404.9333,
        "BuyQty": 21,
        "BuyValue": 29503.5993,
        "Exch": "N",
        "ExchType": "C",
        "LTP": 1299,
        "MtoM": -1377.1329,
        "Multiplier": 0,
        "NetQty": 13,
        "OrderFor": "S",
        "ScripCode": 2885,
        "ScripName": "RELIANCE",
        "SellAvgRate": 1401.875,
        "SellQty": 8,
        "SellValue": 11215
      }
    ],
    "Status": 0,
    "TimeStamp": "/Date(1557823383172+0530)/"
  }
}