Developer APIs

Margin API Download

Purpose

This API is used to fetch Client’s Available Margin details

Request URL https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V3/Margin

Request Method POST
Request format: JSON

Request Header Content-Type:application/json

Request Body

Header

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

*Note:- All fields are mandatory (cannot be empty)

Body

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

*Note:- All fields are mandatory (cannot be empty)

Response Body

Field Name Description Data Type (max length) Sample Value
Status Returns the status of the response. Integer A.-1
B.0
C.1
D.2
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 12345678
EquityMargin Array List of Margin Details Array List of Margin Details -
TimeStamp It gives the server time when Margin summary is provided by server DateTime /Date(1538377480067+0530)/

Margin Details

Field Name Description Data Type (max length)
ALB Ledger Balance at the beginning of the day Double
Adhoc Adhoc margin provided to customer for the day Double
AvailableMargin Actual Available margin available to the customer for trading Double
GHV Gross Holding Value Double
GHVPer Gross Holding Value Cover % Double
GrossMargin Gross Margin of the customer Double
Mgn4PendOrd Margin blocked for pending orders Double
Mgn4Position Margin blocked for open positions Double
OptionsMtoMLoss Margin blocked for M2M loss in Options position Double
Payments Any funds withdrawn from 5paisa today Double
Receipts Any funds added to the ledger today Double
THV Total Holding Value Double
PDHV Adjusted Holding Value post any applicable Haircut Double

Sample Request

Copy Copied
{
    "head": {
    "appName": "APPTRIAL",
    "appVer": "1.0",
    "key": "ue73jH6AKVXeEzBsasdawG5ss9ugyrAyKYxg",
    "osName": "Android",
    "requestCode": "5PMarginV3",
    "userId": "s9RzKCasa1qdasjdL9N",
    "password": "nznS4fasdewxasd34zXw"
    },
    "body": {
    "ClientCode": "12345678"
    }
}

Sample Response

{
        "body": {
        "ClientCode": "12345678",
        "EquityMargin": [
    {
        "ALB": 2794.05,
        "Adhoc": 0,
        "AvailableMargin": 547.75,
        "GHV": 52.1,
        "GHVPer": 100,
        "GrossMargin": 535.73,
        "Mgn4PendOrd": 0,
        "Mgn4Position": 0.8,
        "OptionsMtoMLoss": 0,
        "PDHV": 41.68,
        "Payments": -2300,
        "Receipts": 0,
        "THV": 5427.42
    }
    ],
        "Message": "",
        "Status": 0,
        "TimeStamp": "/Date(1556183887614+0530)/"
    },
        "head": {
        "responseCode": "5PMarginV3",
        "status": "0",
        "statusDescription": "Success"
    }
}