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 | Details |
---|---|---|
POST | api/od-rest/orders/execute | Place a new order |
POST | api/od-rest/order/modify | Modify a pending order |
POST | api/od-rest/orders/cancel | Cancel a pending order |
POST | api/od-rest/orders/getmargin | Get order margin |
GET | api/od-rest/info/orderbook | Retrieve the list of all orders for the day |
GET | api/od-rest/info/tradebook | Retrieve the list of all trades for the day |
POST | api/od-rest/info/history | Get order history |
Place Order¶
Request Structure
[
{
"exchange": "NSE",
"qty": "1",
"price": "1",
"product": "MIS",
"transType": "BUY",
"priceType": "MKT",
"triggerPrice": 0,
"ret": "DAY",
"disclosedQty": 0,
"mktProtection": "",
"target": 1,
"stopLoss": 1,
"orderType": "AMO",
"token": "25"
}
]
Input parameters
Field | Type | Description |
---|---|---|
exchange | String | Code representing the exchange where the trade is executed |
qty | String | Quantity of the instrument to be traded. |
price | String | Price specified for the trade; for market orders, it may be set to a placeholder. |
product | String | Product category of the trade. |
transType | String | Type of transaction, indicating whether the trade is a "BUY" or "SELL" |
priceType | String | Price type(L or MKT or SL or SL-M) |
triggerPrice | Number | Price at which a conditional order activates; relevant for stop orders. |
ret | String | Validity period of the order, specifying how long it remains active. |
disclosedQty | Number | Portion of the quantity revealed to the market; used in large trades for transparency. |
mktProtection | String | Protection setting to limit adverse market impacts; may be left blank if not applicable. |
target | Number | Target price for the order; the order aims to achieve this price if possible. |
stopLoss | Number | Stop-loss threshold to limit losses on the trade. |
orderType | String | Type of order |
token | String | Unique identifier assigned to the specific instrument being traded. |
Response Structure
[
{
"status": "Ok",
"message": "Success",
"result": [
{
"requestTime": "",
"orderNo": "AFBJQ00005;"
}
]
}
]
Parameters
Field | Type | Description |
---|---|---|
requestTime | String | Order specific identification generated by Jainam |
orderNo | String | Order Number is defined as Unique number it can be generated while placing the order |
Modify Order¶
Request Structure
{
"exchange": "NSE",
"orderNo": "AFDOB00002>9",
"qty": "2",
"ret": "DAY",
"priceType": "MKT",
"transType": "BUY",
"price": "200",
"triggerPrice": "",
"disclosedQty": "0",
"mktProtection": "",
"target": "0",
"stopLoss": "0",
"tradedQty": "0",
"filledQty": "0",
"product": "MIS",
"orderType": "AMO",
"token": "25"
}
Input parameters
Field | Type | Description |
---|---|---|
exchange | String | Code representing the exchange where the trade is executed |
orderNo | String | Unique identifier for the order assigned by the system. |
qty | String | Quantity of the instrument specified in the order. |
ret | String | Validity period of the order, specifying how long it remains active. |
priceType | String | Price type(L or MKT or SL or SL-M) |
transType | String | Type of transaction, indicating whether the trade is a "BUY" or "SELL" |
price | String | Price at which the order is intended to execute, if applicable. |
triggerPrice | String | Price at which a conditional order triggers, used for stop orders. |
disclosedQty | String | Quantity disclosed to the market for transparency, if different from the full quantity. |
mktProtection | String | Market protection setting to reduce impact on price movement; may be blank if unused. |
target | String | Target price set for the order, indicating a desired price level. |
stopLoss | String | Stop-loss threshold, specifying a price to minimize potential losses. |
tradedQty | String | Quantity that has already been traded from the order. |
filledQty | String | Quantity filled or executed so far in the order. |
product | String | Product category of the trade. |
orderType | String | Type of order |
token | String | Unique token identifier assigned to the instrument being traded. |
Response Structure
[
{
"status": "Ok",
"message": "Success",
"result": [
{
"requestTime": "",
"orderNo": "AFBJQ00013"
}
]
}
]
Parameters
Field | Type | Description |
---|---|---|
requestTime | String | Order specific identification generated by Jainam |
orderNo | 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 |
---|---|---|
exchange | String | Code representing the exchange where the trade is executed |
orderNo | String | Order Number is defined as Unique number it can be generated while placing the order |
orderType | String | Type of order |
Response Structure
[
{
"status": "Ok",
"message": "Success",
"result": [
{
"requestTime": "",
"orderNo": "AFBJQ00013"
}
]
}
]
Parameters
Field | Type | Description |
---|---|---|
requestTime | String | Order specific identification generated by Jainam |
orderNo | String | Order Number is defined as Unique number it can be generated while placing the order |
Order Margin¶
Request Structure
{
"exchange": "NSE",
"qty": "1",
"price": "0",
"product": "MIS",
"transType": "B",
"priceType": "MKT",
"orderType": "Regular",
"triggerPrice":"",
"stopLoss":"",
"orderFlag":"NEW",
"token":"25"
}
Input parameters
Field | Type | Description |
---|---|---|
exchange | String | Code representing the exchange where the trade is executed |
qty | String | Quantity to transact |
price | String | The price at which the order is placed. |
product | String | Product category of the trade. |
transType | String | Type of transaction, indicating whether the trade is a "BUY" or "SELL" |
priceType | String | Price type(L or MKT or SL or SL-M) |
orderType | String | Type of order |
stopLoss | String | A stop-loss order specifies that a trade is to be executed once a security reaches a certain price |
orderFlag | String | Indicator of the order status or type, such as "NEW" for a new order. |
token | String | Unique identifier assigned to the instrument being traded. |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"requiredMargin": "903.10",
"availableMargin": "-2.26",
"brokerage": "2.26",
"marginShortfall": "905.36"
}
]
}
Parameters
Field | Type | Description |
---|---|---|
requiredMargin | String | After the order is executed, the necessary balance is called and displayed. |
availableMargin | String | Available Margin represents the total amount of funds that can be utilized for trading |
brokerage | String | Brokerage is the fee that an investor or trader must pay to a brokerage in exchange for its services |
marginShortfall | String | The margin shortfall is the difference between the required margin and the available margin in the form of funds or collateral |
Order Book¶
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"orderNo": "23032200000023",
"userId": "<USER_ID>",
"actId": "<ACT_ID>",
"exch": "NSE",
"qty": "1",
"orderEntryTime": null,
"transType": "B",
"ret": "DAY",
"token": "212",
"multiplier": "1",
"priceFactor": "1.000000",
"pricePrecision": "2",
"lotSize": "1",
"tickSize": "0.05",
"price": "0.00",
"avgTradePrice": null,
"disclosedQty": null,
"product": "NRML",
"priceType": "L",
"orderType": "Regular",
"orderStatus": "REJECTED",
"fillShares": null,
"exchUpdateTime": null,
"exchOrderId": null,
"formattedInsName": "ASHOKLEY-EQ",
"ltp": null,
"rejectedReason": "ORA:Product NRML not enabled on exchange NSE",
"triggerPrice": null,
"target": null,
"stopLoss": null,
"trailingPrice": null,
"orderTime": "18:58:02 22-03-2023",
"rprice": null,
"rqty": null,
"mktProtection": null
}
]
}
Parameters
Field | Type | Description |
---|---|---|
status | String | Status of the response. |
message | String | Message providing more information. |
orderNo | String | Unique order number. |
userId | String | User identifier. |
actId | String | Account identifier. |
exchange | String | Code representing the exchange where the trade is executed |
tradingSymbol | String | Trading symbol of the stock. |
qty | String | Quantity ordered. |
orderEntryTime | String | Time the order was entered. |
transType | String | Type of transaction, indicating whether the trade is a "BUY" or "SELL" |
ret | String | Validity period of the order, specifying how long it remains active. |
token | String | Security token identifier. |
multiplier | String | Order multiplier value. |
priceFactor | String | Factor for price calculation. |
pricePrecision | String | Number of decimal places for price precision. |
lotSize | String | Lot size of the instrument. |
tickSize | String | Minimum price movement. |
price | String | Price at which the order is placed. |
avgTradePrice | String | Average trade price. |
disclosedQty | String | Quantity disclosed in the order book. |
product | String | Product category of the trade. |
priceType | String | Price type(L or MKT or SL or SL-M) |
orderType | String | Type of order |
orderStatus | String | Status of the order, e.g., REJECTED, COMPLETED. |
fillShares | String | Number of shares filled in the order. |
exchUpdateTime | String | Time of the last update from the exchange. |
exchOrderId | String | Exchange order identifier. |
formattedInsName | String | Formatted instrument name. |
ltp | String | Last traded price. |
rejectedReason | String | Reason for order rejection. |
triggerPrice | String | Price at which the order triggers. |
target | String | Target price for the order. |
stopLoss | String | Stop-loss price for the order. |
trailingPrice | String | Trailing price for the order. |
orderTime | String | Time the order was placed. |
rprice | String | Reserve price of the order. |
rqty | String | Reserve quantity of the order. |
mktProtection | String | Market protection value for the order. |
Trade Book¶
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"orderNo": "NWSYF00001J4",
"userId":"<USER_ID>",
"actId": "<ACT_ID>",
"exchange": "NSE_EQ",
"ret": null,
"product": "",
"orderType": "Regular",
"priceType": "",
"fillId": null,
"fillTime": null,
"transType": "BUY",
"qty": null,
"token": "15124",
"fillshares": null,
"fillqty": null,
"pricePrecision": null,
"lotSize": null,
"tickSize": null,
"price": null,
"prcftr": null,
"fillprc": null,
"exchUpdateTime": null,
"exchOrderId": "66545",
"formattedInsName": null,
"ltp": null,
"orderTime": "2023-04-26 15:59:50"
}
]
}
Parameters
Field | Type | Description |
---|---|---|
orderNo | String | Unique identifier generated when placing the order. |
userId | String | The identifier for the user who placed the order. |
actId | String | ID of the logged-in user. |
exchange | String | Code representing the exchange where the trade is executed |
ret | String | Validity period of the order, specifying how long it remains active. |
product | String | Product category of the trade. |
orderType | String | Type of order |
priceType | String | Price type(L or MKT or SL or SL-M) |
fillId | String | ID associated with the filled order. |
fillTime | String | Time when the order was filled or executed. |
tranType | String | Type of transaction (e.g., Buy, Sell). |
tradingSymbol | String | The symbol representing the stock or asset being traded. |
KOLTEPATIL | String | Trading symbol KOLTEPATIL |
qty | String | The quantity of shares or units being traded. |
token | String | Unique code for companies listed on the exchange. It identifies the company's instrument. |
fillshares | String | Number of shares that have been filled or executed. |
fillqty | String | Quantity of the instrument that has been filled or executed. This represents the actual number of shares or units transacted. |
pricePrecision | String | The number of decimal places or digits that the price of an instrument is rounded to on the exchange. |
lotSize | String | The number of units in one lot of the trading instrument. |
tickSize | String | The minimum price movement of the trading instrument. |
price | String | Price at which the main leg of the bracket order will be placed. |
fillprc | String | Price at which the order was filled or executed. |
exchUpdateTime | String | Time when the order status was last updated on the exchange. |
exchOrderId | String | Order ID assigned by the exchange. |
formattedInsName | String | Formatted name or identifier of the instrument. |
ltp | String | Last Traded Price; the most recent price at which the security was traded. |
OrderTime | String | Time when the order was placed or initiated. |
Order History¶
Request Structure
Input parameters
Field | Type | Description |
---|---|---|
orderNo | String | Order Number is defined as Unique number it can be generated while placing the order |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"orderNo": "AFBJQ00013;",
"userId": "<USER_ID>"
"actId": "",
"exchange": "NFO",
"quantity": "50",
"transType": "BUY",
"priceType": "",
"orderType": "SL-MKT",
"ret": "",
"token": "",
"pricePrecision": "",
"lotSize": "",
"tickSize": "",
"price": "15.50",
"avgPrice": "",
"disclosedQty": "",
"product": "INTRADAY",
"status": "AMOACCEPTED",
"report": "",
"fillshares": "50",
"time": "2023-11-16 18:21:03",
"exchTime": "1900-01-01 00:00:10",
"remarks": "",
"exchOrderNo": "0",
}
]
}
Parameters
Field | Type | Description |
---|---|---|
Status | String | Current status of the order (e.g., Executed, Pending, Cancelled). |
message | String | Any messages or alerts related to the order. |
orderNo | String | Unique identifier for the order. |
accountId | String | Account ID associated with the order. |
exchange | String | Code representing the exchange where the trade is executed |
quantity | Int | The quantity of the security in the order. |
transType | String | Type of transaction, indicating whether the trade is a "BUY" or "SELL" |
priceType | String | Price type(L or MKT or SL or SL-M) |
orderType | String | Type of order |
ret | String | Validity period of the order, specifying how long it remains active. |
token | String | Unique token representing the instrument. |
pricePrecision | Int | The precision of the price value. |
lotSize | Int | The lot size of the instrument. |
tickSize | Int | The smallest price increment possible. |
price | Int | The price at which the order is placed. |
averagePrice | Int | The average price at which the order was executed. |
disclosedQty | Int | Quantity disclosed to the market (less than or equal to the total quantity). |
product | String | Product category of the trade. |
status | String | Current status of the order (duplicate of the first Status). |
report | String | Reporting information for the order. |
filledshares | Int | Number of shares that have been executed. |
time | String | Time when the order was placed. |
exchangeTime | String | Time when the order was processed by the exchange. |
remarks | String | Any additional remarks related to the order. |
exchangeOrderNo | String | The order number assigned by the exchange. |