Skip to content

Orders

The order management API lets you place a new order, cancel or modify the pending order, retrieve the order status, trade status, order book & tradebook

Type API Endpoint Description
POST /orders/web/execute Places a new buy/sell order (market, limit, etc.) in the system.
GET /info/orderbook Retrieves the order book, i.e., list of all orders placed for the current day.
POST /info/history Fetches order history, including past days' orders (useful for audit or tracking).
POST /orders/modify Modifies an existing open/pending order with new parameters (e.g., price, quantity).
POST /orders/cancel Cancels an open or pending order.
GET /info/tradebook Retrieves the trade book, i.e., list of all executed trades for the day.
POST /orders/getmargin Calculates and returns the margin required for placing a given order.

Place Order

Submits a buy or sell request for a product or asset, including details like symbol, quantity, price, and order type. Ensures secure processing using user and device authentication.

Request Structure

[
    {
        "exchange": "NSE",
        "qty": "1",
        "price": "7.45",
        "product": "MIS",
        "transType": "B",
        "priceType": "L",
        "triggerPrice": "0",
        "ret": "DAY",
        "disclosedQty": "0",
        "mktProtection": "",
        "target": "0",
        "stopLoss": "0",
        "orderType": "Regular",
        "token": "14366",
        "source": "WEB",
        "tradingSymbol": "IDEA_EQ"
    }
]

Input parameters

Field Type Description Required Status
exchange String Exchange code (e.g., NCX, NSE, MCX) Required
qty String Quantity to trade Required
price String Price per unit (ignored if market order) Conditionally Required
(Required for L & SL, ignored for MKT)
product String Product type (MIS, CNC, NRML) Required
transType String Transaction type: B = Buy, S = Sell Required
priceType String Order type: L = Limit, MKT = Market, SL = Stop Loss, etc. Required
triggerPrice String Trigger price (for SL or SL-M orders) Conditionally Required
(Only for SL, SL-M)
ret String Order validity: DAY, IOC, etc. Required
disclosedQty String Quantity disclosed to market Optional
mktProtection String For protection in market orders Optional
target String Target price (used in bracket orders) Conditionally Required
stopLoss String Stop loss value (used in bracket orders) Conditionally Required
orderType String Order type: Regular, Cover, Bracket, etc. Required
token String Token ID for the instrument Required
source String Source of order (e.g., WEB, MOBILE) Required
tradingSymbol String Trading symbol of the instrument Required

Response Structure

[
    {
        "status": "Ok",
        "message": "Success",
        "result": [
            {
                "requestTime": "15:39:26 18-06-2025",
                "orderNo": "25061800000145"
            }
        ]
    }
]

Parameters

Field Type Description
status String Status of the response
message String Message indicating result status
result Array Array of result objects
requestTime String Time of the request
orderNo String Order number generated

Fetch Order Book

The Order Book API provides a list of all orders placed by the user during the trading day. This includes orders in all states such as Open, Executed, Cancelled, or Rejected.

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "orderNo": "25061800000145",
            "userId": "XXXXXX",
            "actId": "XXXXXX",
            "exchange": "NSE",
            "tradingSymbol": "IDEA-EQ",
            "qty": "1",
            "transType": "B",
            "ret": "DAY",
            "token": "14366",
            "multiplier": "1",
            "lotSize": "1",
            "tickSize": "0.01",
            "price": "7.45",
            "avgTradePrice": null,
            "disclosedQty": "0",
            "product": "MIS",
            "priceType": "L",
            "orderType": "Regular",
            "orderStatus": "REJECTED",
            "fillShares": "0",
            "exchUpdateTime": null,
            "exchOrderId": null,
            "formattedInsName": null,
            "ltp": null,
            "rejectedReason": "RED:RULE:{Check circuit limit including square off order}Current:INR 7.45 LowerCircuit:INR 5.94 UpperCircuit:INR 7.26:NSE.IDEA-EQ for C-XXXXXX [DEFAULT]",
            "triggerPrice": null,
            "mktProtection": null,
            "target": null,
            "stopLoss": null,
            "trailingPrice": null,
            "orderTime": "15:39:26 18-06-2025",
            "snoOrderNumber": null,
            "snoFillid": null,
            "remarks": "POCKET",
            "rprice": "0.00",
            "rqty": "0"
        }   
    ]
}

Parameters

Field Type Description
orderNo String Order number
userId String User ID associated with the order
actId String Account ID associated with the order
exchange String Stock exchange where the order is placed
tradingSymbol String Trading symbol of the financial instrument
qty String Quantity of the financial instrument
transType String Transaction type (e.g., B for Buy)
ret String Order validity (e.g., DAY for day orders)
token String Unique identifier for the financial instrument
multiplier String Multiplier for the instrument
lotSize String Lot size for the instrument
tickSize String Tick size for the instrument
price String Order price
avgTradePrice String Average trade price
disclosedQty String Disclosed quantity
product String Type of product (e.g., MIS for Margin Intraday Square-off)
priceType String Type of price (e.g., L for Limit Price)
orderType String Type of order (e.g., AMO for After Market Order)
orderStatus String Status of the order (e.g., REJECTED)
fillShares String Number of shares filled
exchUpdateTime String Exchange update time
exchOrderId String Exchange order ID
formattedInsName String Formatted instrument name
ltp String Last traded price
rejectedReason String Reason for rejection (if order is rejected)
triggerPrice String Trigger price for the order
mktProtection String Market protection
target String Target price for the order
stopLoss String Stop loss price for the order
trailingPrice String Trailing stop loss price
orderTime String Time when the order was placed
snoOrderNumber String Serial number order number
snoFillid String Serial number fill ID
rprice String Reserved price
rqty String Reserved quantity

Order History

The Order History API provides the complete timeline and audit trail of a specific order, including every modification, rejection, execution, or cancellation event related to that order.

Request Structure

{
   "orderNo": "23020400000012"
}

Input parameters

Field Type Description
orderNo String Order number

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "orderNo": "25061800000145",
            "userId": "XXXXXX",
            "actId": "XXXXXX",
            "exchange": "NSE",
            "tradingSymbol": "IDEA-EQ",
            "quantity": "1",
            "transType": "B",
            "priceType": "L",
            "orderType": "Regular",
            "ret": "DAY",
            "token": "14366",
            "pricePrecision": "2",
            "lotSize": "1",
            "tickSize": "0.01",
            "price": "78.45",
            "avgPrice": null,
            "disclosedQty": "0",
            "product": "MIS",
            "status": "REJECTED",
            "report": "ReplaceRejected",
            "fillshares": "0",
            "time": "16:38:53 18-06-2025",
            "exchTime": null,
            "remarks": "POCKET",
            "exchOrderNo": null
        },
        {
            "orderNo": "25061800000145",
            "userId": "XXXXXX",
            "actId": "XXXXXX",
            "exchange": "NSE",
            "tradingSymbol": "IDEA-EQ",
            "quantity": "1",
            "transType": "B",
            "priceType": "L",
            "orderType": "Regular",
            "ret": "DAY",
            "token": "14366",
            "pricePrecision": "2",
            "lotSize": "1",
            "tickSize": "0.01",
            "price": "78.45",
            "avgPrice": null,
            "disclosedQty": "0",
            "product": "MIS",
            "status": "REJECTED",
            "report": "Rejected",
            "fillshares": "0",
            "time": "15:39:26 18-06-2025",
            "exchTime": null,
            "remarks": "POCKET",
            "exchOrderNo": null
        },
        {
            "orderNo": "25061800000145",
            "userId": "XXXXXX",
            "actId": "XXXXXX",
            "exchange": "NSE",
            "tradingSymbol": "IDEA-EQ",
            "quantity": "1",
            "transType": "B",
            "priceType": "L",
            "orderType": "Regular",
            "ret": "DAY",
            "token": "14366",
            "pricePrecision": "2",
            "lotSize": "1",
            "tickSize": "0.01",
            "price": "78.45",
            "avgPrice": null,
            "disclosedQty": "0",
            "product": "MIS",
            "status": "PENDING",
            "report": "NewAck",
            "fillshares": "0",
            "time": "15:39:26 18-06-2025",
            "exchTime": null,
            "remarks": "POCKET",
            "exchOrderNo": null
        }
    ]
}

parameters

Field Type Description
orderNo String Order number
userId String User ID associated with the order
actId String Account ID associated with the order
exchange String Stock exchange where the order is placed
tradingSymbol String Trading symbol of the financial instrument
qty String Quantity of the financial instrument
transType String Transaction type (e.g., B for Buy)
ret String Order validity (e.g., DAY for day orders)
token String Unique identifier for the financial instrument
multiplier String Multiplier for the instrument
lotSize String Lot size for the instrument
tickSize String Tick size for the instrument
price String Order price
avgTradePrice String Average trade price
disclosedQty String Disclosed quantity
product String Type of product (e.g., MIS for Margin Intraday Square-off)
priceType String Type of price (e.g., L for Limit Price)
orderType String Type of order (e.g., AMO for After Market Order)
orderStatus String Status of the order (e.g., REJECTED)
fillShares String Number of shares filled
exchUpdateTime String Exchange update time
exchOrderId String Exchange order ID
formattedInsName String Formatted instrument name
ltp String Last traded price
rejectedReason String Reason for rejection (if order is rejected)
triggerPrice String Trigger price for the order
mktProtection String Market protection
target String Target price for the order
stopLoss String Stop loss price for the order
trailingPrice String Trailing stop loss price
orderTime String Time when the order was placed
snoOrderNumber String Serial number order number
snoFillid String Serial number fill ID
rprice String Reserved price
rqty String Reserved quantity

Modify Order

The Modify Order API is used to change the parameters of an already placed order that is still pending (not fully executed or canceled). You can update fields like price, quantity, order type, etc.

Request Structure

{
    "exchange": "NSE",
    "tradingSymbol": "IDEA_EQ",
    "orderNo": "25061800000145",
    "qty":"20",
    "ret": "DAY",
    "priceType": "L",
    "transType": "B",
    "price": "7.4",
    "triggerPrice": "",
    "disclosedQty": "",
    "mktProtection": "",
    "target": "",
    "stopLoss": "",
    "trailingPrice": ""
}

Input parameters

Field Type Description Required Status
exchange String Exchange code (NCX, NSE, MCX, etc.) Required
tradingSymbol String Symbol of the instrument Required
orderNo String Order number to be modified Required
qty String Modified quantity Required
ret String Order validity: DAY, IOC, etc. Required
priceType String Order type: L = Limit, MKT = Market, SL = Stop Loss Required
transType String Transaction type: B = Buy, S = Sell Required
price String Modified price Conditionally Required
(Required for L, SL orders)
triggerPrice String Trigger price for SL/SL-M orders Conditionally Required
(Only for SL, SL-M orders)
disclosedQty String Disclosed quantity Optional
mktProtection String Market order protection points Optional
target String Bracket order target value Conditionally Required
stopLoss String Bracket order stop loss value Conditionally Required
trailingPrice String Trailing SL price difference Optional

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "requestTime": "19:37:27 07-11-2023",
            "orderNo": "23110700391484"
        }
    ]
}

Parameters

Field Type Description
status String Status of the response
message String Message indicating result status
result Array Array of result objects
requestTime String Time of the request
orderNo String Order number generated

|

Cancel Order

The Cancel Order API allows users to cancel an existing open order using its orderNo.

Request Structure

[
    {
        "orderNo": "25061800000145"
    }
]

Input parameters

Field Type Description
userId String The unique, permanent user ID registered with the broker

Response Structure

[
    {
        "status": "Ok",
        "message": "Success",
        "result": [
            {
                "requestTime": "19:38:26 07-11-2023",
                "orderNo": "23110700391484"
            }
        ]
    }
]

Parameters

Field Type Description
status String Status of the response
message String Message indicating result status
result Array Array of result objects
requestTime String Time of the request
orderNo String Order number generated

Fetch Trade Book

The Tradebook provides a detailed record of executed trades for a user. It lists all completed trades (buy/sell) that occurred after an order was matched on the exchange. This is essential for tracking filled orders, average prices, and calculating profit/loss.

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "orderNo": "23012000000022",
            "userId": "J111",
            "actId": "J111",
            "exchange": "NSE",
            "priceType": "MKT",
            "ret": "DAY",
            "product": "C",
            "fillId": "75989650",
            "fillTime": "03-02-2023 09:55:32",
            "tranType": "B",
            "tradingSymbol": "SITINET-EQ",
            "qty": "1",
            "token": "13998",
            "fillshares": "1",
            "fillqty": "1",
            "pricePrecision": "2",
            "lotSize": "1",
            "tickSize": "0.05",
            "price": "0.00",
            "prcftr": "1.000000",
            "fillprc": "1.50",
            "exchUpdateTime": "03-02-2023 09:55:32",
            "exchOrderId": "1300000005328214",
            "formattedInsName": "SITINET-EQ",
            "ltp": null
        }
    ]
}

parameters

Field Type Description
orderNo String Order number
userId String User ID associated with the trade
actId String Account ID associated with the trade
exchange String Stock exchange where the trade occurred
priceType String Type of price (e.g., MKT for Market Price)
ret String Order validity (e.g., DAY for day orders)
product String Type of product (e.g., C for Cash)
fillId String Fill ID representing the trade
fillTime String Time when the trade was filled
tranType String Transaction type (e.g., B for Buy)
tradingSymbol String Trading symbol of the financial instrument
qty String Quantity of the financial instrument traded
token String Unique identifier for the financial instrument
fillshares String Number of shares filled in the trade
fillqty String Quantity filled in the trade
pricePrecision String Precision of the trade price
lotSize String Lot size of the financial instrument
tickSize String Tick size of the financial instrument
price String Price of the trade
prcftr String Price factor for the trade
fillprc String Price at which the trade was filled
exchUpdateTime String Exchange update time for the trade
exchOrderId String Exchange order ID for the trade
formattedInsName String Formatted instrument name for the trade
ltp String Last traded price (if available)

OrderMargin

The Order Margin API is used to calculate the margin requirements before placing an order. It helps traders estimate the required funds for different types of trades (equity, F&O, commodities, etc.) based on order parameters like quantity, price, product type, and order type.

Request Structure

{
    "exchange": "NSE",
    "tradingSymbol": "ZOMATO-EQ",
    "qty": "1",
    "price": "0",
    "product": "MIS",
    "transType": "B",
    "priceType": "MKT",
    "orderType": "Regular",
    "triggerPrice":"",
    "stopLoss":""
}

Input parameters

Field Value Description
exchange String Stock exchange where the order is placed
tradingSymbol String Trading symbol of the financial instrument
qty String Quantity of the financial instrument
price String Order price
product String Type of product (e.g., MIS for Margin Intraday Square-off)
transType String Transaction type (e.g., B for Buy)
priceType String Type of price (e.g., L for Limit Price)
orderType String Type of order (e.g., AMO for After Market Order)
triggerPrice String Trigger price for the order
stopLoss String Stop loss price for the order

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "marginUsed": "465.46",
            "marginUsedTrade": "465.46"
        }
    ]
}

Parameters

Field Type Description
status String Status of the response
message String Message indicating result status
result Array Array of result objects
marginUsed String Margin used for the order
marginUsedTrade String Margin used for the trade

GTT Orders

Type API Endpoint Description
POST /orders/gtt/execute Executes a GTT order when the trigger condition is met.
POST /orders/gtt/modify Modifies an existing GTT order's trigger or order details.
GET /info/gtt/orderbook Retrieves the list of all active, triggered, or canceled GTT orders.

Place GTT Order

Executes a Good Till Triggered (GTT) order when predefined trigger conditions are met. The order is placed automatically based on preset price levels and remains active until executed or manually canceled.

Request Structure

{
    "exchange": "NSE",
    "qty": "1",
    "price": "6.00",
    "product": "MIS",
    "transType": "B",
    "priceType": "MKT",
    "ret": "DAY",
    "orderType": "Cover",
    "token": "14366",
    "tradingSymbol": "IDEA-EQ",
    "validity": "GTT",
    "gttValue": "7",
    "gttType": "LTP_B_O"
}

Input parameters

Field Type Description
exchange String Name of the exchange where the order will be placed (e.g., NSE, BSE).
qty String / Integer Quantity to be ordered. Treated as a string here but ideally numeric.
price String / Decimal Price of the order. Not required for market orders; relevant in others.
product String Product type, e.g., MIS (Margin Intraday Square-off), CNC, NRML.
transType String Transaction type: B for Buy, S for Sell.
priceType String Price type: MKT (Market), LMT (Limit), etc.
ret String Retention type: DAY, IOC, etc. (order validity for the trading day).
orderType String Type of order: e.g., Cover, Regular, Bracket.
token String Internal token or unique identifier for the security/instrument.
tradingSymbol String Trading symbol of the instrument (e.g., IDEA-EQ).
validity String Validity type: here, GTT means Good Till Triggered.
gttValue String / Decimal Trigger price at which the GTT order should be executed.
gttType String GTT type, e.g., LTP_B_O – Last Traded Price Based Buy Order.

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "requestTime": "11:29:50 19-06-2025",
            "orderNo": "25061900000001"
        }
    ]
}

Parameters

Field Type Description
status String Status of the response
message String Message indicating result status
result Array Array of result objects
requestTime String Time of the request
orderNo String Order number generated

Modify GTT

Updates an existing Good Till Triggered (GTT) order by changing parameters like trigger price, quantity, or order type. The modified GTT remains active until the new trigger condition is met or the order is canceled. Used to adjust trading strategies without creating a new GTT.

Request Structure

{
    "tradingSymbol": "DEEPAKNTR-EQ",
    "exchange": "NSE",
    "transType": "B",
    "priceType": "L",
    "product": "CNC",
    "ret": "DAY",
    "qty": "7",
    "price": "6.6",
    "orderType": "Regular",
    "token": "14366",
    "gttType": "LTP_B_O",
    "gttValue": "7",
    "validity": "GTT",
    "orderNo": "25061900000001"
}

Input parameters

Field Type Description
tradingSymbol String Symbol of the instrument to be traded (e.g., DEEPAKNTR-EQ).
exchange String Exchange where the instrument is listed (e.g., NSE, BSE).
transType String Transaction type: B for Buy, S for Sell.
priceType String Order pricing type: L for Limit, MKT for Market.
product String Product type: CNC (delivery), MIS (intraday), etc.
ret String Retention type: typically DAY.
qty String / Integer Quantity of the order to be placed.
price String / Decimal Limit price for the order. Relevant if priceType is L.
orderType String Order classification: Regular, Cover, etc.
token String Instrument token ID used internally by the trading system.
gttType String GTT trigger type, e.g., LTP_B_O (Last Traded Price Based Buy Order).
gttValue String / Decimal New trigger price for GTT execution.
validity String Order validity: GTT (Good Till Triggered).
orderNo String Unique identifier of the existing GTT order to be modified.

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "requestTime": "11:31:19 19-06-2025",
            "orderNo": "25061900000001"
        }
    ]
}

Parameters

Field Type Description
status String Status of the response
message String Message indicating result status
result Array Array of result objects
requestTime String Time of the request
orderNo String Order number generated

GTT OrderBook

Retrieves a list of all Good Till Triggered (GTT) orders placed by the user. The response includes details like trading symbol, trigger price, order type, quantity, status, and timestamps. It helps users track active, triggered, or canceled GTT orders for effective order management.

Response Structure

{
    "status": "Ok",
    "message": "Success",
    "result": [
        {
            "gttType": "LTP_B_O",
            "orderNo": "25061900000001",
            "tradingSymbol": "IDEA-EQ",
            "exchange": "NSE",
            "token": "19943",
            "remarks": "",
            "validity": "GTT",
            "orderTime": "11:29:50 19-06-2025",
            "priceprecision": "2",
            "lotSize": "1",
            "tickSize": "0.01",
            "transType": "B",
            "priceType": "L",
            "qty": "7",
            "price": "7.00",
            "product": "CNC",
            "gttValue": "7.00",
            "orderType": "Regular",
            "disclosedQty": null,
            "formattedInsName": "DEEPAKNTR-EQ",
            "oiVariables": [
                {
                    "var_name": "x",
                    "d": "2105.00"
                }
            ],
            "placeOrderParamsleg2": null,
            "placeOrderParams": {
                "actId": "TEST102",
                "tranType": "B",
                "priceType": "LMT",
                "quantity": 7,
                "price": "7.00",
                "productAlias": "CNC",
                "product": "C",
                "orderSource": "API",
                "ipAddress": "13.127.86.119",
                "triggerPrice": "6.50",
                "c": "C"
            }
        }
    ]
}

parameters

Field Type Description
status String API response status (e.g., Ok, Error).
message String Response message indicating result.
result Array List of GTT orders placed by the user.
gttType String GTT trigger type (e.g., LTP_B_O = Last Traded Price Based Buy Order).
orderNo String Unique GTT order number.
tradingSymbol String Symbol of the instrument (e.g., IDEA-EQ).
exchange String Exchange where the order is placed (NSE, BSE).
token String Internal token ID for the instrument.
remarks String User or system-generated remarks (if any).
validity String Order validity type (always GTT here).
orderTime String Timestamp of when the GTT was created (format: HH🇲🇲ss dd-MM-yyyy).
priceprecision String Decimal precision allowed for the instrument's price.
lotSize String Minimum order quantity multiple.
tickSize String Minimum price movement allowed for the instrument.
transType String B = Buy, S = Sell.
priceType String Price type, e.g., L for Limit, MKT for Market.
qty String Quantity specified in the GTT order.
price String Limit price to execute the order.
product String Product type (e.g., CNC, MIS, NRML).
gttValue String Trigger price for the GTT to be executed.
orderType String Order type, usually Regular, Cover, etc.
disclosedQty Null Quantity disclosed to the market (null if not set).
formattedInsName String Display-friendly instrument name.
oiVariables Array Custom variables for technical or UI use (e.g., trigger level display).
placeOrderParamsleg2 Null Parameters for second leg (used in bracket or OCO orders; null here).
placeOrderParams Object Order details for the primary leg, used for placement upon trigger.
actId String Account or user ID.
tranType String Transaction type (B for Buy).
priceType String Order price type (LMT = Limit).
quantity Integer Quantity to be ordered.
price String Price at which the order will be placed upon trigger.
productAlias String Alias for product type (e.g., CNC for delivery-based orders).
product String Abbreviated product code (e.g., C for CNC).
orderSource String Source of order (e.g., API, WEB, MOBILE).
ipAddress String IP address from where the order was initiated.
triggerPrice String Price that triggers the GTT.
c String Possibly internal category code.