Back to home
Doc Fundamentals
API Reference
Funds Management
Market Data
Order Management
Portfolio Management
User Authentication
Multi order margin
This API calculates the margin required for given set of orders. If input is single scrip then margin required for single order is provided if input is multiple scripts then combined margin with hedge benefit is provided. API also accepts parameter CoverPositions if yes the margin is calculated considering existing positions.
REQUEST URL
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/MultiOrderMargin
Request headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| Authorization | bearer{your access token} |
SAMPLE REQUEST URL
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/MultiOrderMarginRequest body
| Field Name | Mandatory | Description | ||
| Head | key | Yes | AppKey of User or Partner | |
| body | Client Code | Yes | Client code of user | |
| Cover Positions | Yes | |||
| Orders | Exchange | Exchange of the insrument | ||
| Exchange Type | Type of exchange | |||
| Scrip Code | Scrip code of the instrument traded | |||
| PlaceModifyCancel | User has to put what function they need: P: Place ,M:Modify,C:Cancel | |||
| Order Type | Type of order | |||
| Price | The price at which order took place at market | |||
| Quantity | The quantity of the orders placed | |||
| IsIntraday | Either the order was intraday or not . Pass boolean value: True/False | |||
SAMPLE REQUEST BODY :
{
"head": {
"key": "6zWyCzzGupJnB7bllZEzlgKbzVCJ7viT"
},
"body": {
"ClientCode": "52839446",
"CoverPositions":"N",
"Orders": [
{
"Exch": "N",
"ExchType": "D",
"ScripCode": "53480",
"ScripData": "",
"PlaceModifyCancel": "P",
"OrderType": "B",
"Price": 274,
"Qty": 3000,
"IsIntraday":false
}
]
}
}
Response Body
| Field Name | Values | Description | |
|---|---|---|---|
| head | responseCode | 5PMultiOrderMargin | This is the unique response code for the API. |
| status | -1: Server unable to process your request 0: Success 1: Invalid input parameters. 2: Invalid head parameters. | This is the status code which depicts the status of API request to the server. | |
| statusDescription | Server unable to process your request Success Invalid input parameters. Invalid head parameters. | This is the description of the status received from the server for the API request. | |
| body | AvailableMargin | Numeric value | This shows the margin available for user's account |
| Message | Success Invalid client code | The message depicts if margin has been fetched succesfully by putting in correct parameters | |
| Status | -1: Server unable to process your request 0: Success 1: Invalid input parameters. 2: Invalid head parameters. | This is the status code which depicts the status of API request to the server. | |
| TotalMarginRequired | Numerical value | This calculates the total margin required for you to correctly place the order | |
Response body :
{
"body": {
"AvailableMargin": 0,
"Message": "Success",
"Status": 0,
"TotalMarginRequired": 145122
},
"head": {
"responseCode": "5PMultiOrderMargin",
"status": "0",
"statusDescription": "Success"
}
}
On this Page