Groww LogoGroww API

Margin

This guide describes how to calculate required margin for orders and get available user margin using the SDK.

Get Available User Margin

Easily retrieve your available margin details using this get_available_margin_details method.

Python SDK Usage

from growwapi import GrowwAPI
 
# Groww API Credentials (Replace with your actual credentials)
API_AUTH_TOKEN = "your_token"
 
# Initialize Groww API
groww = GrowwAPI(API_AUTH_TOKEN)
 
available_margin_details_response = groww.get_available_margin_details()
print(available_margin_details_response)

Response Payload

All prices in rupees.

{
  "clear_cash": 96.21,
  "net_margin_used": 1.8,
  "brokerage_and_charges": 0.0,
  "collateral_used": 0.0,
  "collateral_available": 0.0,
  "adhoc_margin": 0.0,
  "fno_margin_details": {
    "net_fno_margin_used": 0.0,
    "span_margin_used": 0.0,
    "exposure_margin_used": 0.0,
    "future_balance_available": 94.41,
    "option_buy_balance_available": 94.41,
    "option_sell_balance_available": 94.41
  },
  "equity_margin_details": {
    "net_equity_margin_used": -1.8,
    "cnc_margin_used": -1.8,
    "mis_margin_used": 0.0,
    "cnc_balance_available": 94.41,
    "mis_balance_available": 94.41
  }
}

Response Schema

NameTypeDescription
clear_cashfloatClear cash available
net_margin_usedfloatNet margin used
brokerage_and_chargesfloatBrokerage and charges
collateral_usedfloatCollateral used
collateral_availablefloatCollateral available
adhoc_marginfloatAdhoc margin available
net_fno_margin_usedfloatNet FnO margin used
span_margin_usedfloatSpan Margin Used
exposure_margin_usedfloatExposure Margin Used
future_balance_availablefloatFuture Balance Available
option_buy_balance_availablefloatOption Buy Balance Available
option_sell_balance_availablefloatOption Sell Balance Available
net_equity_margin_usedfloatNet equity margin used
cnc_margin_usedfloatCNC margin used
mis_margin_usedfloatMIS margin used
cnc_balance_availablefloatCNC balance available
mis_balance_availablefloatMIS balance available

Required Margin For Order

Calculate the required margin for a single order or basket of orders using this get_order_margin_details method. Basket orders are only supported for FNO Segment.

Python SDK Usage

from growwapi import GrowwAPI
 
# Groww API Credentials (Replace with your actual credentials)
API_AUTH_TOKEN = "your_token"
 
# Initialize Groww API
groww = GrowwAPI(API_AUTH_TOKEN)
 
order_details = [
    
    {
        "trading_symbol": "RELIANCE",
        "transaction_type": groww.TRANSACTION_TYPE_BUY,
        "quantity": 1,
        "price": 2500, # Optional: Price (include for limit orders; omit or adjust if not applicable).
        "order_type": groww.ORDER_TYPE_LIMIT,
        "product": groww.PRODUCT_CNC,
        "exchange": groww.EXCHANGE_NSE
    }
]
order_margin_details_response = groww.get_order_margin_details(
  segment=groww.SEGMENT_CASH,
  orders=order_details,
)
print(order_margin_details_response)

Request Schema

NameTypeDescription
trading_symbol *stringTrading Symbol of the instrument as defined by the exchange
quantity *integerQuantity of instrument to order
pricedecimalPrice of the instrument in rupees case of Limit order
exchange *stringStock exchange
segment *stringSegment of the instrument such as CASH, FNO etc.
product *stringProduct type
order_type *stringOrder type
transaction_type *stringTransaction type of the trade

*required parameters

Response Payload

All prices in rupees.

{
  "exposure_required": 0.0, 
  "span_required": 0.0, 
  "option_buy_premium": 0.0, 
  "brokerage_and_charges": 0.2, 
  "total_requirement": 100.2, 
  "cash_cnc_margin_required": 100.0, "physical_delivery_margin_requirement": 0.0
}

Response Schema

NameTypeDescription
exposure_requiredfloatMargin required to cover the exposure for the trade.
span_requiredfloatSPAN margin required for F&O trades (not applicable for equity cash segment).
option_buy_premiumfloatPremium amount required for buying options contracts.
brokerage_and_chargesfloatTotal brokerage and other exchange-related charges for the order.
total_requirementfloatTotal margin requirement including all charges and margin components.
cash_cnc_margin_requiredfloatMargin required for CNC (Cash & Carry) orders in the cash segment.
cash_mis_margin_requiredfloatMargin required for MIS (Margin Intraday Square-off) orders in the cash segment.
physical_delivery_margin_requirementfloatAdditional margin required for physical settlement of derivative contracts.

On this page