Margin
PURPOSE
This API is used to fetch Client’s Available Margin details. This API can only be used in an active session when a client is logged in with valid credentials. The only parameter passed in the request is the client’s ID which is passed to the system and is responded with Client’s equity margin which includes margin for positions, margin for pending order, additional margin given by risk, cash load receipts, payouts made, unclear cheque amount, ledger balance and undelivered stock amount, all used to calculate gross margin avaialable with the client. The method returns status of execution of the API and also a message to be displayed along with the status of response to call of API.
Request URL
https://dataservice.iifl.in/openapi/prod/MarginRequest 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. | IIFLMarRQMarginV3 |
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": "IIFLMarRQMarginV3",
"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) |
Sample Value |
---|---|---|---|
Status | Returns the status of the response. | Integer | -1 = Exception 0 = success 1=No Record Found 2- Invalid Input/ head parameters 9-“Invalid Session” |
Message | Returns the message of the reponse. | String | "Server Unable to process your request" “Success” “No records found” “Invalid input parameters.” |
ClientCode | Returns client code | String | S0002 |
EquityMargin | EquityMargin | Array List of Margin Details | - |
TimeStamp | It gives the server time when Margin summary is provided by server | DateTime | "/Date(1557815425763+0530)/" |
MARGIN DETAILS
FieldName | Type | Description |
---|---|---|
Lb | Double(10) | Ledger Balance |
UnclChq | Double(8) | unclear cheque amount. |
Undlv | Double(8) | Undelivered stock amount |
NDDebit | Double(8) | NDDebit |
OptionsMtoMLoss | Double(8) | MtoM loss in option trading |
ALB | Double(15) | Adjustable ledger balance. |
Receipts | Double(8) | Online amount received by client. |
Payments | Double(8) | Payout given to client. |
Adhoc | Double(8) | Additional limits given by risk |
PDHV | Double(8) | Double((8) |
GrossMargin | Double(20) | GrossMargin |
Mgn4Position | Double(15) | Margin taken for executed orders (Open Position) |
Mgn4PendOrd | Mgn4PendOrd | Margin Blocked for Pending Orders. |
Success Response
{
"head": {
"responseCode": "IIFLMarRQMarginV3",
"status": "0",
"statusDescription": "Success"
},
"body": {
"ClientCode": "Dummy123",
"EquityMargin": [
{
"ALB": 100000,
"Adhoc": 100000,
"AvailableMargin": 99796748.5337,
"GHV": 0,
"GHVPer": 0,
"GrossMargin": 100181000,
"Lb": 12685,
"Mgn4PendOrd": 233545.9,
"Mgn4Position": -150705.5663,
"NDDebit": 0,
"OptionsMtoMLoss": 0,
"PDHV": 0,
"Payments": -19000,
"Receipts": 0,
"THV": 0,
"UnclChq": 0,
"Undlv": 0
}
],
"Message": "",
"Status": 0,
"TimeStamp": "/Date(1557815425763+0530)/"
}
}