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.
Base_URL: https://protrade.jainam.in/
| Type | API | Details |
|---|---|---|
| POST | {{BASE_URL}}omt/api-order-rest/v1/orders/placeorder | Place Order submits a buy or sell request for a specific asset. |
| GET | {{BASE_URL}}omt/api-order-rest/v1/orders/book | An Order Book is a real-time record of all buy and sell orders. |
| POST | {{BASE_URL}}omt/api-order-rest/v1/orders/history | Order History is a record of all past buy and sell orders made by a user. |
| POST | {{BASE_URL}}omt/api-order-rest/v1/orders/modify | Modify orders means changing an existing order’s price, quantity, or type. |
| POST | {{BASE_URL}}omt/api-order-rest/v1/orders/cancel | Cancel orders means to revoke or delete a placed order before execution. |
| GET | {{BASE_URL}}omt/api-order-rest/v1/orders/trades | TradeBook records all executed trades with details like price, quantity, and time. |
| POST | {{BASE_URL}}omt/ od-rest-api/v1/orders/checkMargin | Single Order Margin provides margin details required for placing a specific order. |
Place Order¶
Request Structure
[
{
"exchange": "NSE",
"instrumentId": "14366",
"transactionType": "BUY",
"quantity": 10,
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "LIMIT",
"price": "6.3",
"validity": "DAY",
"slTriggerPrice": "",
"trailingSlAmount": "",
"apiOrderSource": "",
"algoId": "",
"marketProtectionPercent": "",
"disclosedQuantity":"",
"orderTag":""
}
]
Input parameters
| Field | Type | Criticality | Description |
|---|---|---|---|
| instrumentId | String | Required | Unique identifier assigned to the specific instrument being traded. |
| exchange | String | Required | Code representing the exchange where the trade is executed. |
| transactionType | String | Required | Type of transaction, indicating whether the trade is a "BUY" or "SELL". |
| quantity | Int | Required | Quantity of the instrument to be traded. |
| orderComplexity | String | Required | Complexity level of the order (e.g., REGULAR, AMO). |
| product | String | Required | Product category of the trade (e.g., INTRADAY, LONGTERM, MTF). |
| orderType | String | Required | Price type: Limit, Market, SL, SLM. |
| validity | String | Required | Validity period of the order (e.g., DAY, IOC). |
| price | String | Conditionally Required | Price specified for the trade; may be ignored for market orders. |
| slTriggerPrice | String | Conditionally Required | Trigger price for stop-loss orders. |
| trailingSlAmount | String | Optional | Amount by which the stop-loss will trail the market price. |
| disclosedQuantity | Int | Optional | Portion of the total quantity disclosed to the market. |
| marketProtectionPercent | String | Optional | Allowed percentage deviation from the market price to protect from slippage. |
| apiOrderSource | String | Optional | Source identifier for API-based orders. |
| algoId | String | Optional | Identifier for the algorithm placing the order. |
| orderTag | String | Optional | Custom tag to identify or group orders (user-defined). |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"requestTime": "26-May-2025 11:42:10",
"brokerOrderId": "250526000002697"
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| requestTime | String | when the API request was initiated by the client, used for logging, tracking, or validating request timing. |
| brokerOrderId | String | Broker orderId is defined as Unique number it can be generated while placing the order. |
Order Book¶
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"clientId": "DK2200295",
"placedBy": "DK2200295",
"brokerOrderId": "250526000002881",
"exchange": "NSE",
"exchangeOrderId": "1100000048194096",
"formattedInstrumentName": "IDEA",
"tradingSymbol": "IDEA-EQ",
"instrumentId": "14366",
"transactionType": "BUY",
"quantity": 10,
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "LIMIT",
"price": 6.30,
"averageTradedPrice": 0.00,
"slTriggerPrice": 0.00,
"validity": "DAY",
"disclosedQuantity": 0,
"orderTime": "2025-05-26 12:32:05",
"exchangeUpdateTime": "2025-05-26 12:32:05",
"rejectionReason": "--",
"mainLegOrderId": "",
"cancelledQuantity": 0,
"pendingQuantity": 10,
"filledQuantity": 0,
"appKey": "",
"algoId": "",
"source": "API",
"orderTag": "--",
"trailingSlAmount": 0,
"brokerUpdateTime": "",
"marketProtectionPercent": "--",
"exchangeTimestamp": "",
"orderStatus": "OPEN"
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| clientId | String | UCC client ID. |
| placedBy | String | Dealer/Client code who placed the order. |
| brokerOrderId | String | Unique ID assigned to the order by the broker. |
| exchange | String | Exchange and segment (e.g., NSE,BSE). |
| exchangeOrderId | String | Unique ID assigned to the order by the exchange. |
| formattedInstrumentName | String | Full name of the instrument. |
| tradingSymbol | String | Trading symbol of the instrument. |
| instrumentId | String | Unique identifier or scrip code of the instrument. |
| transactionType | String | Type of transaction:Buy or Sell. |
| quantity | Int | Total quantity for the order. |
| product | String | Product type (e.g., INTRADAY, LONGTERM). |
| orderComplexity | String | Type of order: REGULAR, AMO, etc. |
| orderType | String | Order pricing type: LIMIT, MARKET, SL, SLM. |
| price | Float | Limit price entered by the client. |
| averageTradedPrice | Float | Weighted average price of matched trades. |
| slTriggerPrice | Float | Stop Loss trigger price. |
| validity | String | Order validity duration (e.g., DAY, IOC). |
| disclosedQuantity | Int | Quantity to be disclosed in market feed. |
| orderTime | DateTime | Date and time when the order was initially placed on the exchange or by the client. |
| exchangeUpdateTime | DateTime | Time when the latest update for this order came from exchange. |
| rejectionReason | String | Reason for order rejection. |
| mainLegOrderId | String | Identifier for the main/parent order in a bracket order. |
| cancelledQuantity | Int | Quantity of the order that was cancelled. |
| pendingQuantity | Int | Quantity of the order still pending. |
| filledQuantity | Int | Quantity of the order that has been filled. |
| appKey | String | App key of the client/vendor/franchise that placed the order. |
| algoId | String | Identifier for the algorithm placing the order. |
| source | String | Origin of the order (Web, App, API, etc.). |
| orderTag | String | User-defined tag for internal tracking. |
| trailingSLAmount | Int | Amount by which SL price trails the market. |
| brokerUpdateTime | DateTime | Timestamp when the broker last updated the order. |
| marketProtectionPercent | String | Price deviation limit for market protection. |
| exchangeTimestamp | DateTime | Timestamp when the order was placed. |
| orderStatus | String | Current status of the order (e.g., rejected, open, complete). |
Order History¶
Request Structure
Input Parameters
| Field | Type | Description |
|---|---|---|
| brokerOrderId | String | Unique ID assigned to the order by the broker. |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"clientId": "DK2200295",
"placedBy": "DK2200295",
"brokerOrderId": "250526000002881",
"exchange": "NSE",
"exchangeOrderId": "1100000048194096",
"formattedInstrumentName": "IDEA",
"tradingSymbol": "IDEA-EQ",
"instrumentId": "14366",
"transactionType": "BUY",
"quantity": 10,
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "LIMIT",
"price": 6.30,
"averageTradedPrice": 0.00,
"slTriggerPrice": 0.00,
"validity": "DAY",
"disclosedQuantity": 0,
"orderTime": "2025-05-26 12:32:05",
"exchangeUpdateTime": "2025-05-26 12:32:05",
"rejectionReason": "--",
"mainLegOrderId": "",
"cancelledQuantity": 0,
"pendingQuantity": 10,
"filledQuantity": 0,
"appKey": "",
"algoId": "",
"source": "API",
"orderTag": "",
"trailingSlAmount": 0,
"brokerUpdateTime": "",
"marketProtectionPercent": "0",
"exchangeTimestamp": "26-May-2025 12:32:05",
"orderStatus": "open"
},
{
"clientId": "DK2200295",
"placedBy": "--",
"brokerOrderId": "250526000002881",
"exchange": "NSE",
"exchangeOrderId": "",
"formattedInstrumentName": "IDEA",
"tradingSymbol": "IDEA-EQ",
"instrumentId": "14366",
"transactionType": "BUY",
"quantity": 10,
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "LIMIT",
"price": 6.30,
"averageTradedPrice": 0.00,
"slTriggerPrice": 0.00,
"validity": "DAY",
"disclosedQuantity": 0,
"orderTime": "2025-05-26 12:32:05",
"exchangeUpdateTime": "2025-05-26 12:32:05",
"rejectionReason": "--",
"mainLegOrderId": "",
"cancelledQuantity": 0,
"pendingQuantity": 10,
"filledQuantity": 0,
"appKey": "",
"algoId": "",
"source": "API",
"orderTag": "",
"trailingSlAmount": 0,
"brokerUpdateTime": "",
"marketProtectionPercent": "0",
"exchangeTimestamp": "--",
"orderStatus": "open pending"
},
{
"clientId": "DK2200295",
"placedBy": "--",
"brokerOrderId": "250526000002881",
"exchange": "NSE",
"exchangeOrderId": "",
"formattedInstrumentName": "IDEA",
"tradingSymbol": "IDEA-EQ",
"instrumentId": "14366",
"transactionType": "BUY",
"quantity": 10,
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "LIMIT",
"price": 6.30,
"averageTradedPrice": 0.00,
"slTriggerPrice": 0.00,
"validity": "DAY",
"disclosedQuantity": 0,
"orderTime": "2025-05-26 12:32:05",
"exchangeUpdateTime": "2025-05-26 12:32:05",
"rejectionReason": "--",
"mainLegOrderId": "",
"cancelledQuantity": 0,
"pendingQuantity": 10,
"filledQuantity": 0,
"appKey": "",
"algoId": "",
"source": "API",
"orderTag": "",
"trailingSlAmount": 0,
"brokerUpdateTime": "",
"marketProtectionPercent": "0",
"exchangeTimestamp": "--",
"orderStatus": "validation pending"
},
{
"clientId": "DK2200295",
"placedBy": "--",
"brokerOrderId": "250526000002881",
"exchange": "NSE",
"exchangeOrderId": "",
"formattedInstrumentName": "IDEA",
"tradingSymbol": "IDEA-EQ",
"instrumentId": "14366",
"transactionType": "BUY",
"quantity": 10,
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "LIMIT",
"price": 6.30,
"averageTradedPrice": 0.00,
"slTriggerPrice": 0.00,
"validity": "DAY",
"disclosedQuantity": 0,
"orderTime": "2025-05-26 12:32:05",
"exchangeUpdateTime": "2025-05-26 12:32:05",
"rejectionReason": "--",
"mainLegOrderId": "",
"cancelledQuantity": 0,
"pendingQuantity": 10,
"filledQuantity": 0,
"appKey": "",
"algoId": "",
"source": "API",
"orderTag": "",
"trailingSlAmount": 0,
"brokerUpdateTime": "",
"marketProtectionPercent": "0",
"exchangeTimestamp": "--",
"orderStatus": "put order req received"
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| clientId | String | UCC client ID. |
| placedBy | String | Dealer/Client code who placed the order. |
| brokerOrderId | String | Unique ID assigned to the order by the broker. |
| exchange | String | Exchange and segment (e.g., NSE,BSE). |
| exchangeOrderId | String | Unique ID assigned to the order by the exchange. |
| formattedInstrumentName | String | Full name of the instrument. |
| tradingSymbol | String | Trading symbol of the instrument. |
| instrumentId | String | Unique identifier or scrip code of the instrument. |
| transactionType | String | Type of transaction:Buy or Sell. |
| quantity | Int | Total quantity for the order. |
| product | String | Product type (e.g., INTRADAY, LONGTERM). |
| orderComplexity | String | Type of order: REGULAR, AMO, etc. |
| orderType | String | Order pricing type: LIMIT, MARKET, SL, SLM. |
| price | Float | Limit price entered by the client. |
| averageTradedPrice | Float | Weighted average price of matched trades. |
| slTriggerPrice | Float | Stop Loss trigger price. |
| validity | String | Order validity duration (e.g., DAY, IOC). |
| disclosedQuantity | Int | Quantity to be disclosed in market feed. |
| orderTime | DateTime | Date and time when the order was initially placed on the exchange or by the client. |
| exchangeUpdateTime | DateTime | Time when the latest update for this order came from exchange. |
| rejectionReason | String | Reason for order rejection. |
| mainLegOrderId | String | Identifier for the main/parent order in a bracket order. |
| cancelledQuantity | Int | Quantity of the order that was cancelled. |
| pendingQuantity | Int | Quantity of the order still pending. |
| filledQuantity | Int | Quantity of the order that has been filled. |
| appKey | String | App key of the client/vendor/franchise that placed the order. |
| algoId | String | Identifier for the algorithm placing the order. |
| source | String | Origin of the order (Web, App, API, etc.). |
| orderTag | String | User-defined tag for internal tracking. |
| trailingSLAmount | Int | Amount by which SL price trails the market. |
| brokerUpdateTime | DateTime | Timestamp when the broker last updated the order. |
| marketProtectionPercent | String | Price deviation limit for market protection. |
| exchangeTimestamp | DateTime | Timestamp when the order was placed. |
| orderStatus | String | Current status of the order (e.g., rejected, open, complete). |
Modify Order¶
Request Structure
{
"brokerOrderId":"250526000002881"
"quantity": 20,
"orderType": "limit",
"price": "6.5",
"slTriggerPrice": "",
"validity":"",
"disclosedQuantity": "",
"marketProtectionPercent": "",
"trailingSLAmount": ""
}
Input parameters
| Field | Type | Criticality | Description |
|---|---|---|---|
| brokerOrderId | String | Required | Unique ID assigned to the order by the broker. |
| quantity | Int | Optional | Quantity of the instrument specified in the order. |
| orderType | String | Optional | Order pricing type: LIMIT, MARKET, SL, SLM. |
| price | String | Conditionally Required | Price at which the order is intended to execute, if applicable. |
| slTriggerPrice | String | Conditionally Required | Price at which a conditional order triggers, used for stop orders. |
| validity | String | Optional | Order validity duration (e.g., DAY, IOC). |
| disclosedQuantity | String | Optional | Quantity disclosed to the market for transparency, if different from the full quantity. |
| marketProtectionPercent | String | Optional | Market protection setting to reduce impact on price movement; may be blank if unused. |
| trailingSLAmount | String | Optional | Amount by which SL price trails the market. |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"brokerOrderId": "250526000002881",
"requestTime": "26-May-2025 13:11:34"
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| requestTime | String | when the API request was initiated by the client, used for logging, tracking, or validating request timing. |
| brokerOrderId | String | Order Number is defined as Unique number it can be generated while placing the order. |
Cancel Order¶
Request Structure
Input Parameters| Field | Type | Description |
|---|---|---|
| brokerOrderId | String | Unique ID assigned to the order by the broker. |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"brokerOrderId": "250526000002881",
"requestTime": "26-May-2025 14:24:36"
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| requestTime | String | when the API request was initiated by the client, used for logging, tracking, or validating request timing. |
| brokerOrderId | String | Order Number is defined as Unique number it can be generated while placing the order. |
Trade Book¶
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"clientId": "DK2200295",
"placedBy": "DK2200295",
"brokerOrderId": "250526000005634",
"exchangeOrderId": "1100000067912030",
"exchangeTradeId": "207745115",
"formattedInstrumentName": "IDEA",
"tradingSymbol": "IDEA-EQ",
"instrumentId": "14366",
"exchange": "NSE",
"transactionType": "BUY",
"product": "LONGTERM",
"orderComplexity": "REGULAR",
"orderType": "MARKET",
"validity": "DAY",
"tradedPrice": 6.95,
"filledQuantity": 1,
"orderTime": "2025-05-26 14:27:43",
"fillTimestamp": "2025-05-26 14:27:43",
"orderTag": "--",
"algoId": ""
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| clientId | String | UCC client ID. |
| placedBy | String | Dealer/Client code who placed the order. |
| brokerOrderId | String | Unique ID assigned to the order by the broker. |
| exchangeOrderId | String | Unique ID assigned to the order by the exchange. |
| exchangeTradeId | String | A unique identifier assigned by the exchange to each executed trade |
| formattedInstrumentName | String | Full name of the instrument. |
| tradingSymbol | String | Trading symbol of the instrument. |
| instrumentId | String | Unique identifier or scrip code of the instrument. |
| exchange | String | Exchange and segment (e.g., NSE,BSE). |
| transactionType | String | Type of transaction:Buy or Sell. |
| product | String | Product type (e.g., INTRADAY, LONGTERM). |
| orderComplexity | String | Type of order: REGULAR, AMO, etc. |
| orderType | String | Order pricing type: LIMIT, MARKET, SL, SLM. |
| validity | String | Order validity duration (e.g., DAY, IOC). |
| tradedPrice | Number | Weighted average price of matched trades. |
| filledQuantity | Number | Quantity of the order that has been filled. |
| orderTime | DateTime | Date and time when the order was initially placed on the exchange or by the client. |
| fillTimestamp | DateTime | The exact date and time when the order was executed (filled) on the exchange. |
| algoId | String | Identifier for the algorithm placing the order. |
| orderTag | String | User-defined tag for internal tracking. |
Order Margin¶
Request Structure
{
"exchange": "NSEEQ",
"instrumentId": "22",
"transactionType": "BUY",
"quantity": 1,
"product": "intraday",
"orderComplexity": "regular",
"orderType": "market",
"price": "",
"validity": " day",
"slTriggerPrice": ""
}
Input parameters
| Field | Type | Description |
|---|---|---|
| exchange | String | Exchange and segment (e.g., NSE,BSE). |
| instrumentId | String | Unique identifier or scrip code of the instrument. |
| transactionType | String | Type of transaction:Buy or Sell. |
| quantity | Number | Total quantity for the order. |
| product | String | Product type (e.g., INTRADAY, LONGTERM). |
| orderComplexity | String | Type of order: REGULAR, AMO, etc. |
| orderType | String | Order pricing type: LIMIT, MARKET, SL, SLM. |
| price | Number | Limit price entered by the client. |
| validity | String | Order validity duration (e.g., DAY, IOC). |
| slTriggerPrice | String | Trigger price for stop-loss orders. |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"status": "Ok",
"message": "Success",
"totalCashAvailable": "52926",
"preOrderMargin": "",
"postOrderMargin": "183.65",
"currentOrderMargin": "113.70",
"rmsValidationCheck": "",
"fundShort": ""
}
]
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| totalCashAvailable | String | The total cash amount available in the trading account. |
| preOrderMargin | String | Margin utilized before placing the current order. |
| postOrderMargin | String | Margin amount required or reserved after placing the current order. |
| currentOrderMargin | String | Margin needed specifically for the current order. |
| rmsValidationCheck | String | Result or status of the Risk Management System validation (empty if no issues). |
| fundShort | String | Indicates any shortfall in funds required for the order. |