Skip to content

Get Orders

orders() fetches grouped Trading API V3 order snapshots using NubraTrader(nubra).

get_order() fetches order snapshots directly by Trading API V3 intentOrderId.

Use the same retrieval method for:

  • single orders
  • independent multi-order items
  • strategy orders

For strategy 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 strategy order get method or a basket_id retrieval flow for Trading API V3. For strategy orders, 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

nubra = InitNubraSdk(NubraEnv.PROD, env_creds=True)
trader = NubraTrader(nubra)

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")
alpha_orders = trader.orders(strat_tags="alpha-tag")
tagged_orders = trader.orders(strat_tags=["alpha-tag", "beta-tag"])

Filter By Strategy Tags

Use orders(strat_tags=...) when you want to fetch orders by tag.

For filtering, strat_tags accepts one tag string or a list of tag strings. Each tag must use hyphen-separated text only.

alpha_orders = trader.orders(strat_tags="alpha-tag")

tagged_orders = trader.orders(strat_tags=["alpha-tag", "beta-tag"])

The response keeps the normal grouped bucket shape under orders, such as open, executed, cancelled, rejected, expired, and gtt.

Fetch By Intent Order ID

Use get_order(...) when you already know the Trading API V3 intentOrderId.

get_order() accepts either one intentOrderId or a list of intentOrderId values.

single_order = trader.get_order(12345)

selected_orders = trader.get_order([12345, 12346])

The response is a list of matching order objects.

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)

Strategy orders

For strategy orders, the returned order has isMulti=True and leg details under legs[]. Use the strategy-level intentOrderId with get_order(), modify, and cancel workflows. Do not look for a separate basket_id in Trading API V3.

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
strat_tags str \| list[str] filter by one strategy tag or a list of strategy tags. Tag values use hyphen-separated text only.

Response Contract

orders() returns GetIntentOrdersResponse.

get_order() returns a list of matching order objects.

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] strategy order 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. Tag values use hyphen-separated text only.
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 orders(strat_tags=...) when fetching orders by strategy tags.
  • Use get_order(...) when fetching directly by one or more intentOrderId values.
  • Use status, symbol, delivery_type, exchange, and strat_tags as filters.
  • Single, multi-order, and strategy orders are all returned from the same Trading API V3 endpoint.
  • Strategy orders have one strategy intentOrderId; inspect legs[] for leg details.
  • Use the strategy intentOrderId for strategy order 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