Holding
PURPOSE
This method is used to provide the client’s holdings as of beginning of the day. This API can only be used in an active session when a client is logged in with valid credentials. The only parameter passed on the request is the client’s ID which is passed to the system and is responded with a dataset which comprises of current value, yesterday value, current PL, current price, previous close, funded quantity and collateral quantity among other things. The method responds with status of execution of API and a message along with the requisite type of status.
Request URL
https://dataservice.iifl.in/openapi/prod/HoldingRequest 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. | IIFLMarRQHoldingV2 |
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": "IIFLMarRQHoldingV2",
"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 | - |
“Success” “Invalid input parameters.” “Invalid head parameters.” “Error while processing your request.” |
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 0 = success 1=No Record Found 2- Invalid Input/ head parameters 9-“Invalid Session” |
CacheTime | Cachetime of after how much seconds this API should be called again | Integer(4) | - | - |
CacheTime | Cachetime of after how much seconds this API should be called again | Integer(4) | - | - |
Data | This field contain the array (collection) of HoldingRecordV1 class. | HoldingRecordV2 array (Collection) | List | - |
Holdin
FieldName | Type | Description |
---|---|---|
Exch | Char | Gets the Exchange of the scrip.(N-Nse,B-Bse) |
ExchType | Char | Exchange segment of the scrip (C-Cash, D-Derivative, U-Currency) |
NseCode | Integer | NSE Scrip Code |
BseCode | Integer | BSE Scrip Code |
Symbol | String | Symbol of the scrip |
FullName | String | Full Name of that Scrip |
Quantity | Long | Available BOD quantity |
CurrentValue | Double(10) | Current price of the share (symbol) |
YesterDayValue | Double(8) | YesterDayValue of that scrip |
CurrentPL | Double(4) | CurrentPL of that Scrip |
PerChange | Int64(20) | Order ID given by Exchange to an order. |
ExchangeTradeID | Double(10) | PerChange of that Scrip |
CurrentPrice | Double(15) | CurrentPriceof that Scrip |
PreviousClose | Double(10) | PreviousClose of that Scrip |
FundedQty | Long | FundedQty of that Scrip |
collateralQty | Long(4) | collateralQty of that Scrip |
Success Response
{
"head": {
"responseCode": "IIFLMarRQHoldingV2",
"status": "0",
"statusDescription": "Success"
},
"body": {
"CacheTime": 300,
"Data": [
{
"BseCode": 500209,
"CurrentPL": 0,
"CurrentPrice": 720,
"CurrentValue": 0,
"Exch": "N",
"ExchType": "C",
"FullName": "INFOSYS LIMITED",
"FundedQty": 0,
"NseCode": 1594,
"PerChange": -0.49,
"PreviousClose": 723.6,
"Quantity": 0,
"Symbol": "INFY",
"YesterDayValue": 0,
"collateralQty": 0
},
{
"BseCode": 500325,
"CurrentPL": -1088500,
"CurrentPrice": 1300,
"CurrentValue": 13000000,
"Exch": "N",
"ExchType": "C",
"FullName": "RELIANCE INDUSTRIES LTD",
"FundedQty": 0,
"NseCode": 2885,
"PerChange": -7.72,
"PreviousClose": 1408.85,
"Quantity": 10000,
"Symbol": "RELIANCE",
"YesterDayValue": 14088500,
"collateralQty": 0
}
],
"Message": "Success",
"Status": 0
}
}