Skip to content

Get Orders

orders() fetches grouped Trading API V3 order snapshots when NubraTrader is initialized with TradingAPIVersion.V3.

Use the same retrieval method for:

  • single orders
  • independent multi-order items
  • flexi / multi-leg strategy orders

For flexi orders created with isMultiLeg=True, Trading API V3 returns one strategy-level order with isMulti=True and a non-empty legs list. The strategy has one intentOrderId; leg rows are details under that strategy order.

LLM guidance

Use this page for all Trading API V3 order retrieval. Generate trader.orders(...) and inspect grouped orders. Do not generate a separate flexi get method or a basket_id retrieval flow for Trading API V3. For flexi / multi-leg strategies, inspect isMulti, legs, stratTags, entryConfig, and exitConfig.

Basic Usage

from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import TradingAPIVersion

nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)

all_orders = trader.orders()
open_orders = trader.orders(status="OPEN")
nifty_orders = trader.orders(symbol="NIFTY", exchange="NSE")
iday_orders = trader.orders(delivery_type="IDAY")

Accessing Orders

for group_name, order_list in all_orders.orders.items():
    print(group_name)

    for order in order_list:
        print(order.intentOrderId)
        print(order.status)
        print(order.isMulti)
        print(order.refId)
        print(order.orderQty)
        print(order.filledQty)
        print(order.entryPrice)
        print(order.ltp)

        if order.entryConfig:
            print(order.entryConfig.entryTime)
            for condition in order.entryConfig.conditions or []:
                print(condition.kind, condition.threshold, condition.status)

        for trigger in order.exitConfig:
            print(trigger.exitTriggerKind)
            print(trigger.conditionKind)
            print(trigger.triggerPrice)
            print(trigger.limitPrice)
            print(trigger.trailJump)
            print(trigger.status)

Accessing Flexi Strategy Legs

result = trader.orders(status="OPEN")

for group_name, order_list in result.orders.items():
    for order in order_list:
        if order.isMulti:
            print("strategy order id:", order.intentOrderId)
            print("strategy status:", order.status)
            print("strategy entry price:", order.entryPrice)

            for leg in order.legs:
                print(leg.refId)
                print(leg.unitQty)
                print(leg.orderQty)
                print(leg.filledQty)
                print(leg.filledPrice)

Use this pattern to inspect flexi / multi-leg strategy orders. Do not look for a separate basket_id; the strategy intentOrderId is the ID used for get, modify, and cancel workflows.

Request Attributes

Attribute Type Meaning
status str status filter: OPEN, EXECUTED, REJECTED, GTE, CANCELLED, or EXPIRED
symbol str filter by instrument symbol
delivery_type str filter by delivery type such as IDAY or CNC
exchange str filter by exchange such as NSE, BSE, or MCX

Response Contract

orders() returns GetIntentOrdersResponse.

Field Type Meaning
orders dict[str, list[IntentOrderResponse]] grouped Trading API V3 orders
orders.*[].intentOrderId int Trading API V3 order identifier
orders.*[].status str order status
orders.*[].isMulti bool whether this is a multi-leg strategy order
orders.*[].exchange str exchange
orders.*[].legs list[IntentOrderLeg] flexi / multi-leg strategy leg details
orders.*[].refId int single-leg reference ID
orders.*[].refData RefDataWrapper instrument metadata
orders.*[].filledQty int filled quantity
orders.*[].orderQty int order quantity
orders.*[].deliveryType str delivery type
orders.*[].priceType str price type
orders.*[].validityType str validity type
orders.*[].executionMode str execution mode
orders.*[].entryConfig IntentOrderEntryConfig entry conditions
orders.*[].exitConfig list[IntentOrderExitTrigger] exit triggers
orders.*[].stratTags list[str] strategy tags
orders.*[].echoFields str echo metadata
orders.*[].entryPrice int entry price
orders.*[].icebergInfo IntentOrderIcebergParamsResp iceberg fields
orders.*[].expiryTime str expiry timestamp
orders.*[].ltp int latest traded price
orders.*[].orderPrice int order price
orders.*[].filledPrice int filled price
orders.*[].rejectionMsg str rejection reason
orders.*[].timestamps IntentOrderTimestamps lifecycle timestamps
orders.*[].positionId str linked position ID
orders.*[].intentOrderType str Trading API V3 intent order type

Nested Response Fields

Field Meaning
entryConfig.entryTime entry time
entryConfig.conditions[].kind entry condition kind
entryConfig.conditions[].threshold trigger threshold
entryConfig.conditions[].status condition status
exitConfig[].exitTriggerKind exit trigger type
exitConfig[].conditionKind exit condition kind
exitConfig[].triggerPrice exit trigger price
exitConfig[].limitPrice exit limit price
exitConfig[].trailJump trailing-stop jump
exitConfig[].exitTime exit time
exitConfig[].status exit trigger status
legs[].refId leg reference ID
legs[].unitQty per-leg signed unit quantity
legs[].orderQty leg order quantity
legs[].filledQty leg filled quantity
legs[].filledPrice leg fill price
legs[].refData leg instrument metadata

Important Rules

Important Rules

  • Use orders() for all Trading API V3 order retrieval.
  • Use status, symbol, delivery_type, and exchange as filters.
  • Single, multi-order, and flexi / multi-leg strategy orders are all returned from the same Trading API V3 endpoint.
  • Flexi / multi-leg strategy orders have one strategy intentOrderId; inspect legs[] for leg details.
  • Use the strategy intentOrderId for flexi modify and cancel workflows.
  • Interpret order prices and LTP fields using exchange-native integer units such as paise for NSE instruments.
  • Inspect order state before and after modify or cancel workflows when state transitions matter.
  1. Modify Order
  2. Modify Multi Order
  3. Cancel Order
  4. Place Order
NEO Assistant