Margin
Margin Calculator
Endpoint URL
Local Host : POST http://127.0.0.1:5000/api/v1/margin
Ngrok Domain : POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/margin
Custom Domain: POST https://<your-custom-domain>/api/v1/marginBasic Usage
{
"apikey": "<your_app_apikey>",
"positions": [
{
"symbol": "NIFTY30DEC2526000CE",
"exchange": "NFO",
"action": "BUY",
"product": "NRML",
"pricetype": "MARKET",
"quantity": "75",
"price": "0"
}
]
}Sample API Request (Single Position)
Sample API Request (Multiple Positions - Basket)
Sample API Response (Success)
Sample API Response (Error)
Parameter Description
Main Request Parameters
Parameter
Description
Mandatory/Optional
Default Value
Position Object Parameters
Parameter
Description
Mandatory/Optional
Default Value
Response Fields Description
Field
Description
Type
Margin Data Object Fields (Broker-Specific)
Field
Description
Availability
Supported Exchanges
Exchange Code
Description
Supported Product Types
Product
Description
Supported Price Types
Price Type
Description
Supported Actions
Action
Description
Important Notes
Example Use Cases
Use Case 1: Check Margin for Single Stock Purchase
Use Case 2: Iron Condor Strategy (4 Legs)
Use Case 3: Futures Trading Margin
Use Case 4: Stop Loss Order Margin
Error Codes and Messages
Error Message
Cause
Last updated