Skip to content

OptionsMultiOrder

Place multiple option legs in a single request. Ideal for complex options strategies like Iron Condor, Strangles, Spreads, and more. BUY legs are executed before SELL legs for margin efficiency.

Endpoint URL

http
Local Host   :  POST http://127.0.0.1:5000/api/v1/optionsmultiorder
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/optionsmultiorder
Custom Domain:  POST https://<your-custom-domain>/api/v1/optionsmultiorder

Sample API Request (Iron Condor - Same Expiry)

json
{
  "apikey": "<your_app_apikey>",
  "strategy": "Iron Condor Test",
  "underlying": "NIFTY",
  "exchange": "NSE_INDEX",
  "expiry_date": "25NOV25",
  "legs": [
    {"offset": "OTM6", "option_type": "CE", "action": "BUY", "quantity": 65},
    {"offset": "OTM6", "option_type": "PE", "action": "BUY", "quantity": 65},
    {"offset": "OTM4", "option_type": "CE", "action": "SELL", "quantity": 65},
    {"offset": "OTM4", "option_type": "PE", "action": "SELL", "quantity": 65}
  ]
}

Sample cURL Request

bash
curl -X POST http://127.0.0.1:5000/api/v1/optionsmultiorder \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>",
  "strategy": "Iron Condor Test",
  "underlying": "NIFTY",
  "exchange": "NSE_INDEX",
  "expiry_date": "25NOV25",
  "legs": [
    {"offset": "OTM6", "option_type": "CE", "action": "BUY", "quantity": 65},
    {"offset": "OTM6", "option_type": "PE", "action": "BUY", "quantity": 65},
    {"offset": "OTM4", "option_type": "CE", "action": "SELL", "quantity": 65},
    {"offset": "OTM4", "option_type": "PE", "action": "SELL", "quantity": 65}
  ]
}'

Sample API Response (Iron Condor)

json
{
  "status": "success",
  "underlying": "NIFTY",
  "underlying_ltp": 26050.45,
  "results": [
    {
      "action": "BUY",
      "leg": 1,
      "mode": "analyze",
      "offset": "OTM6",
      "option_type": "CE",
      "orderid": "25111996859688",
      "status": "success",
      "symbol": "NIFTY25NOV2526350CE"
    },
    {
      "action": "BUY",
      "leg": 2,
      "mode": "analyze",
      "offset": "OTM6",
      "option_type": "PE",
      "orderid": "25111996042210",
      "status": "success",
      "symbol": "NIFTY25NOV2525750PE"
    },
    {
      "action": "SELL",
      "leg": 3,
      "mode": "analyze",
      "offset": "OTM4",
      "option_type": "CE",
      "orderid": "25111922189638",
      "status": "success",
      "symbol": "NIFTY25NOV2526250CE"
    },
    {
      "action": "SELL",
      "leg": 4,
      "mode": "analyze",
      "offset": "OTM4",
      "option_type": "PE",
      "orderid": "25111919252668",
      "status": "success",
      "symbol": "NIFTY25NOV2525850PE"
    }
  ]
}

Sample API Request (Diagonal Spread - Different Expiry)

json
{
  "apikey": "<your_app_apikey>",
  "strategy": "Diagonal Spread Test",
  "underlying": "NIFTY",
  "exchange": "NSE_INDEX",
  "legs": [
    {"offset": "ITM2", "option_type": "CE", "action": "BUY", "quantity": 65, "expiry_date": "30DEC25"},
    {"offset": "OTM2", "option_type": "CE", "action": "SELL", "quantity": 65, "expiry_date": "25NOV25"}
  ]
}

Sample API Response (Diagonal Spread)

json
{
  "results": [
    {
      "action": "BUY",
      "leg": 1,
      "mode": "analyze",
      "offset": "ITM2",
      "option_type": "CE",
      "orderid": "25111933337854",
      "status": "success",
      "symbol": "NIFTY30DEC2525950CE"
    },
    {
      "action": "SELL",
      "leg": 2,
      "mode": "analyze",
      "offset": "OTM2",
      "option_type": "CE",
      "orderid": "25111957475473",
      "status": "success",
      "symbol": "NIFTY25NOV2526150CE"
    }
  ],
  "status": "success",
  "underlying": "NIFTY",
  "underlying_ltp": 26052.65
}

Request Body

ParameterDescriptionMandatory/OptionalDefault Value
apikeyYour Tradeboard API keyMandatory-
strategyStrategy identifierMandatory-
underlyingUnderlying symbol (NIFTY, BANKNIFTY, etc.)Mandatory-
exchangeUnderlying's exchange. Any value in the shared VALID_EXCHANGES list passes validation; the practical values are NSE_INDEX, NSE, BSE_INDEX, BSEMandatory-
expiry_dateCommon expiry date in DDMMMYY format (can be overridden per leg)OptionalDerived when underlying includes expiry
strike_intStrike interval, positive integer or null. Omit it so the actual strikes in the instrument master are usedOptionalDerived from the instrument master
legsArray of 1 to 20 leg objectsMandatory-

These six fields are the complete top-level OptionsMultiOrderSchema. Any other top-level field returns HTTP 400.

Leg Object Fields

ParameterDescriptionMandatory/OptionalDefault Value
offsetStrike offset: ATM, ITM1-ITM50, OTM1-OTM50Mandatory-
option_typeOption type: CE or PE (lowercase accepted)Mandatory-
actionOrder action: BUY or SELL (lowercase accepted)Mandatory-
quantityOrder quantity, positive integerMandatory-
splitsizeSplit size for this leg (0 = no split)Optional0
expiry_dateLeg-specific expiry (for calendar and diagonal spreads)OptionalUses the top-level expiry
pricetypePrice type: MARKET, LIMIT, SL, SL-MOptionalMARKET
productProduct type: MIS or NRML. CNC is rejected for optionsOptionalMIS
priceLimit price (for LIMIT orders)Optional0
trigger_priceTrigger price (for SL orders)Optional0
disclosed_quantityDisclosed quantityOptional0

A leg carries no symbol and no strike: the contract is resolved from offset plus the shared underlying. Any field outside this list returns HTTP 400 for the whole request.

Response Fields

FieldTypeDescription
statusstring"success" or "error"
underlyingstringUnderlying symbol
underlying_ltpnumberLast traded price of underlying
resultsarrayArray of leg results

Results Array Fields

FieldTypeDescription
legnumberLeg number (1, 2, 3...)
actionstringBUY or SELL
offsetstringOffset used
option_typestringCE or PE
symbolstringResolved option symbol
orderidstringOrder ID from broker
statusstring"success" or "error"
modestring"analyze" in analyzer mode. The key is absent in live mode; there is no "mode": "live"

Supported Strategies

StrategyLegsDescription
Iron Condor4OTM CE buy, OTM PE buy, closer OTM CE sell, closer OTM PE sell
Strangle2OTM CE, OTM PE (same expiry)
Straddle2ATM CE, ATM PE (same expiry)
Bull Call Spread2Buy lower strike CE, sell higher strike CE
Bear Put Spread2Buy higher strike PE, sell lower strike PE
Calendar Spread2Same strike, different expiry
Diagonal Spread2Different strike, different expiry

Notes

  • BUY legs are always executed first for margin efficiency
  • Each leg can have its own expiry_date for calendar/diagonal spreads
  • If a leg fails, subsequent legs are still attempted
  • The underlying_ltp is used for all legs to ensure consistent ATM calculation
  • The request schema accepts 1 to 20 legs; broker limits can be stricter.
  • Rate limit: ORDER_RATE_LIMIT, default 10 requests per second

Back to: API Documentation