Skip to content

Margin Calculation

This API allows you to calculate the margin requirement for an order before placing it. This helps you understand the funds needed and plan your trades accordingly.

Request Type Path Description
GET /margin Calculate margin requirement for an order

Margin Calculation

Calculate the margin requirement for a single order before placing it.

Endpoint

Text Only
GET /margin

Request Body

Parameter Type Description
segment string The market segment. Enum: "DERIVATIVE", "EQUITY"
txnType string The transaction type. Enum: "BUY", "SELL"
quantity string The quantity of the instrument to trade
price string The price per unit
product string The product type. Enum: "MARGIN", "INTRADAY", "CNC"
securityID string The unique identifier for the instrument
exchange string The exchange. Enum: "NSE", "BSE"

Example Request

Bash
curl --location --request GET 'https://api.indstocks.com/margin' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
    "segment": "DERIVATIVE",
    "txnType": "BUY",
    "quantity": "75",
    "price": "10",
    "product": "MARGIN",
    "securityID": "40131",
    "exchange": "NSE"
}'

Response Payload (Success)

JSON
{
  "status": "success",
  "data": {
    "total_margin": 750,
    "span_margin": 0,
    "hedge_benefit": 0,
    "exposure_margin": 0,
    "available_balance": 0,
    "var_margin": 0,
    "insufficient_balance": 0,
    "delivery_margin": 0,
    "brokerage": 0,
    "charges": {
      "stt": 0,
      "exchange_charges": 0,
      "stamp_duty": 0,
      "sebi_turn_over_charges": 0,
      "brokerage": 5,
      "gst": 0.9,
      "IPFTCharges": 0,
      "total_charges": 5.9
    }
  }
}

Response Fields

Field Type Description
total_margin number Total margin required for the order
span_margin number SPAN margin requirement
hedge_benefit number Margin benefit from hedged positions
exposure_margin number Exposure margin requirement
available_balance number Available balance after margin requirement
var_margin number Value at Risk (VAR) margin
insufficient_balance number Shortfall amount if balance is insufficient
delivery_margin number Delivery margin for equity trades
brokerage number Brokerage amount (typically ₹5 per order for API users)

Charges Breakdown

Field Type Description
stt number Securities Transaction Tax
exchange_charges number Exchange transaction charges
stamp_duty number Government stamp duty
sebi_turn_over_charges number SEBI turnover charges
brokerage number Brokerage charges (₹5 per order)
gst number GST on brokerage and charges (18%)
IPFTCharges number Investor Protection Fund Trust charges
total_charges number Sum of all charges

Response Notes

  • All amounts are in INR (Indian Rupees)
  • Brokerage is flat ₹5 per order regardless of order size
  • GST is calculated at 18% on brokerage and other charges
  • total_margin represents the total funds required to place the order
  • For derivative orders, SPAN and exposure margins may apply
  • For equity delivery orders, delivery margin may be applicable