Orders

Place Order

The status of the order is not known at the moment of placing order.

Method POST
Production URL https://openapi.motilaloswal.com/rest/trans/v1/placeorder
Test URL https://uatopenapi.motilaloswal.com/rest/trans/v1/placeorder
Request None or JSON (in case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N Client ID Mandatory in case of Dealer
exchange String(15) Y Name of the Exchange
symboltoken Number Y Exchange Scrip code or Symbol Token is unique identifier
buyorsell String(10) Y Transaction Type (BUY, SELL)
ordertype String(10) Y Order Type(LIMIT, MARKET, STOPLOSS)
producttype String(15) Y Product type (NORMAL, DELIVERY, SELLFROMDP, VALUEPLUS, BTST,MTF)
orderduration String(10) Y Order duration (DAY,GTC,GTD,IOC)
price Decimal(15,4) Y Price in Rupees. Up to 4 decimal places.
triggerprice Decimal(15,4) N Price in Rupees. Up to 4 decimal places.
quantityinlot Number Y Quantity to transact. In terms of Lots
disclosedquantity Number N Quantity to disclose (for equity)
amoorder String(1) N AMO-Order (Y or N)
goodtilldate String(11) N DD-MMM-YYYY
algoid String(10) N Algo Id or Blank for Non-Algo Orders
tag String(10) N Echo back to identify order.
participantcode String(20) N Participant Code

Sample Request (Body)


{
  "clientcode":"", // Client code required only in case of Dealer
  "exchange":"NSE",
  "symboltoken":1660,
  "buyorsell":"BUY",
  "ordertype":"LIMIT",
  "producttype":"Normal",
  "orderduration":"DAY",
  "price":235.5,
  "triggerprice":0,
  "quantityinlot":2,
  "disclosedquantity":0,
  "amoorder":"N",
  "algoid":"",
  "goodtilldate":"30-Jan-2022",
  "tag":" ",   // max 10 characters
  "participantcode": "218450147IH"
}

	
	

Sample Response (Success)

                
{
     "status": "SUCCESS",
     "message": "Order Placed Successfully",
     "errorcode": "",
     "uniqueorderid": "2400155AA020" 
}
	

Sample Response (Failure)

                
{
     "status": "ERROR",
     "message": "Invalid Product Type Parameter",
     "errorcode": "MO1057" 
}
	
Field Type Description
uniqueorderid String(50) Unique Order ID as received in Order place

Modify Order

As long as an order is open or pending in the system, certain attributes of it may be modified.

Method POST
Production URL https://openapi.motilaloswal.com/rest/trans/v2/modifyorder
Test URL https://uatopenapi.motilaloswal.com/rest/trans/v2/modifyorder
Request None or JSON(In case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N Client ID Mandatory in case of Dealer
uniqueorderid String(50) Y Unique Order ID as received in Order Entry Response
newordertype String(10) Y Order Type(LIMIT, MARKET, STOPLOSS)
neworderduration String(10) Y Order duration (DAY,GTC,GTD,IOC)
newprice Decimal(15,4) Y Price in Rupees. Up to 4 decimal places.
newtriggerprice Decimal(15,4) N Price in Rupees. Up to 4 decimal places.
newquantityinlot Number Y Quantity to transact in terms of lot
newdisclosedquantity Number N Quantity to disclose (for equity)
newgoodtilldate String(11) N DD-MMM-YYYY
lastmodifiedtime String(20) Y dd-MMM-yyyy HH:mm:ss
qtytradedtoday Number Y Number of quantity traded today

Sample Request (Body)

                    
                        {
                          "clientcode":"", // Client code required only in case of Dealer
                          "uniqueorderid ":"1101823KAL005",
                          "newordertype":"LIMIT",
                          "neworderduration":"DAY",
                          " newquantityinlot ":100,
                          "newdisclosedquantity":0,
                          "newprice":235.50,
                          "newtriggerprice":0,
                          "newgoodtilldate":"",
                          "lastmodifiedtime": "14-May-2022 11:31:25",
                          "qtytradedtoday": 0
                        }
                    
	

Sample Response (Success)

                
{
  “status": "SUCCESS",
  "message": "Modify Order Request Sent Successfully",
  "errorcode": ""
}

Sample Response (Failure)

                
{
  “status": "ERROR",
  "message": "Invalid Order Duration Parameter",
  "errorcode": "MO1054"
}

Cancel Order

As long as an order is open or pending in the system, it can be cancelled.

Method POST
Production URL https://openapi.motilaloswal.com/rest/trans/v1/cancelorder
Test URL https://uatopenapi.motilaloswal.com/rest/trans/v1/cancelorder
Request None or JSON (in case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N Client ID Mandatory in case of Dealer
uniqueorderid String(50) Y Unique Order ID as received in Order Entry Response

Sample Request (Body)

                
{
   "clientcode":"", // Client code required only in case of Dealer 
   "uniqueorderid":"1101823KAL005"
}
	

Sample Response (Success)

                
{
   "status": "SUCCESS",
   "message": "Cancel Order Request Sent",
   "errorcode": ""
}
	

Sample Response (Failure)

                
{
   "status": "ERROR",
   "message": "Invalid Order Id Input Parameter",
   "errorcode": "MO1060"
}
	

OrderBook

This API allows to fetch the complete information of the Orders of the Users

Method POST
Production URL https://openapi.motilaloswal.com/rest/book/v2/getorderbook
Test URL https://uatopenapi.motilaloswal.com/rest/book/v2/getorderbook
Request None or JSON (in case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N Its Mandatory in case of Dealer

Sample Request (Body)

                
{
   "clientcode":"AA017" // in case of dealer else not required 
}
	

Sample Response

                
{
   "status": "SUCCESS",
   "message": "Order Data",
   "errorcode": ""
   "data": [
			   {
				"ordercategory": "NORMAL",
				"clientid": "AA020",
				"exchange": "BSE",
				"symboltoken": 500116,
				"symbol": "IDBI",
				"series": "A",
				"expirydate": "0",
				"strikeprice": 0,
				"optiontype": "XX ",
				"orderid": "1120001",
				"orderinitiatorid": "27120",
				 "ordertype": "Market",
				"orderduration": "Day",
				"producttype": "NORMAL",
				"error": "Market/Close price not available.",
				"orderstatus": "Error",
				"buyorsell": "Buy",
				"totalqtyremaining": 1,
				"orderqty": 1,
				"qtytradedtoday": 0,
			  	"disclosedqty": 0,
				"price": 0,
				 "triggerprice": 0,
				  "entrydatetime": "0",
				  "lastmodifiedtime": "0",
				 "vendor": "NewOrder",
				    "uniqueorderid": "1000001AA020",
				   "goodtilldate": "0",
				   "algoid": 0,
				  "algocategory": 0
      				"averageprice": 394305,
      				 "totalqtytraded": 1,
				"lotsize": 1,
				"tag":" ",
				"recordinserttime": 14-Feb-2023 10:52:50,
				"participantcode": "218450147IH"
			  },
			 {...}...
		             ]

}
	

Response JSON

Field Type Description
ordercategory String(15) Category of order by default NORMAL
clientid String(50) Client Id
exchange String(50) Name of the Exchange
symboltoken Number Exchange Scrip code or Symbol Token i.e. unique identifier
symbol String(40) Symbol
series String(2) Series
expirydate String(20) Expiry date of scrip
strikeprice Number Strike Price
optiontype String(2) Option Type
orderid String(50) Order ID
orderinitiatorid String(50) Contains logged in ID from which order is generated
ordertype String(10) Order Type(LIMIT, MARKET, STOPLOSS)
orderduration String(50) Order duration (DAY,GTC,GTD,IOC)
producttype String(20) Product type (Normal, Delivery etc.)
error String(1000) Error in case of order is not executed
orderstatus String(50) Current status of the order
buyorsell String(10) Order Transaction Type (BUY, SELL)
totalqtyremaining Number Total quantityremaining for the order
orderqty Number Order Quantity for transactaion
qtytradedtoday Number It contains quantity traded today for the order
disclosedqty Number Order Quantity to be disclosed (for equity)
price Decimal(15,4) Price in Rupees. Up to 4 decimal places.
triggerprice Decimal(15,4) the price at which an order will be triggered
entrydatetime String(40) Time when fresh order is executed
lastmodifiedtime String(40) Time which order last modified
vendor String(50) Name of the vendor
uniqueorderid String(50) Unique Order ID as received in Order
goodtilldate String(40) Date up to which order should be retained
algoid Number Algo Id or Blank for Non-Algo Orders
algocategory Number Algo category
averageprice Decimal(15,4) Average price at which the order was executed
totalqtytraded Number Quantity traded
lotsize Number Quantity of a single lot
tag String(10) Echo back to identify order
recordinserttime String(20) Record Insert Time
participantcode String(20) Participant Code

Trade Book

This API allows to fetch the complete information of the Trades of the Users

Method POST
Production URL https://openapi.motilaloswal.com/rest/book/v1/gettradebook
Test URL https://uatopenapi.motilaloswal.com/rest/book/v1/gettradebook
Request None or JSON (in case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N Its mandatory in case of Dealer

Sample Request (Body)

                    
{
   "clientcode":"AA017" // in case of dealer else not required 
}
	

Sample Response

                    
{
   "status": "SUCCESS",
   "message": "Trade Data",
   "errorcode": ""
   "data": [
			   {
				"clientid": "AA020",
     				 "exchange": "NCDEX",
     				 "symboltoken": "48725",
     				 "producttype": "NORMAL",
      			         "symbol": "COCUDAKL",
  				 "instrumenttype": "FUTCOM",
                		"series": "XX",
      				"strikeprice": -1,
     				"optiontype": "XX",
   				 "expirydate": "20/01/2022",
       				 "lotsize": 10,
     				 "precision": 2,
      			         "multiplier": 10,
     				 "tradeprice": 278400,
      				"tradeqty": 20,
      				"tradevalue": 5568000,
      				"buyorsell": "Sell",
     				 "orderid": "O08mlCpNjtYU",
      				"tradeno": "T27vvFpS6e",
      				"tradetime": "10/01/2022",
				"uniqueorderid": "2700002AA020",
			  },
			 {...}...
		             ]

}
	

Order Detail

This API allows to fetch the complete information of the Orders based on uniqueorderid

Method POST
Production URL https://openapi.motilaloswal.com/rest/book/v2/getorderdetailbyuniqueorderid
Test URL https://uatopenapi.motilaloswal.com/rest/book/v2/getorderdetailbyuniqueorderid
Request None or JSON (in case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N It's mandatory in case of Dealer
uniqueorderid String(50) Y Unique Order ID

Sample Request (Body)


{
  "clientcode":"", // In case of dealer else not required
  "uniqueorderid":"1000001AA020"
}

	
	

Sample Response

                    
{
  "status": "SUCCESS",
  "message": "Order Data",
  "errorcode": "",
  "data": [
{
  "ordercategory": "NORMAL",
  "clientid": "AA020",
  "exchange": "BSE",
  "symboltoken": 500116,
  "symbol": "IDBI",
  "series": "A",
  "expirydate": "0",
  "strikeprice": 0,
  "optiontype": "XX ",
  "orderid": "1120001",
  "orderinitiatorid": "27120",
  "ordertype": "C",
  "booktype": "Market",
  "orderduration": "Day",
  "producttype": "NORMAL",
  "error": "Market/Close price not available.",
  "orderstatus": "Error",
  "buyorsell": "Buy",
  "totalqtyremaining": 1,
  "orderqty": 1,
  "qtytradedtoday": 0,
  "disclosedqty": 0,
  "price": 0,
  "triggerprice": 0,
  "entrydatetime": "0",
  "lastmodifiedtime": "0",
  "vendor": "NewOrder",
  "stoploss": 0,
  "squareoff": 0,
  "trailingstoploss": 0,
  "uniqueorderid": "1000001AA020",
  "goodtilldate": "0",
  "algoid": 0,
  "algocategory": 0,
  "averageprice": 394305,
  "totalqtytraded": 1,
  "lotsize": 1,
  "recordinserttime": 14-Feb-2023 10:52:50,
  "participantcode": "218450147IH"
},
 {...}...
]
}

Trade Detail

This API allows to fetch the complete information of the Trades of the Users based on uniqueorderid

Method POST
Production URL https://openapi.motilaloswal.com/rest/book/v1/gettradedetailbyuniqueorderid
Test URL https://uatopenapi.motilaloswal.com/rest/book/v1/gettradedetailbyuniqueorderid
Request None or JSON (in case of Dealer)
Response JSON

Request JSON

Field Type Mandatory Description
clientcode String(15) N It's mandatory in case of Dealer
uniqueorderid String(50) Y Unique Order ID

Sample Request (Body)


{
  "clientcode":"AA017", // In case of dealer else not required
  "uniqueorderid":"2700002AA020"
}


Sample Response


{
  "status": "SUCCESS",
  "message": "Trade Data",
  "errorcode": "",
  "data": [
{
"clientid": "AA020",
"exchange": "NCDEX",
"symboltoken": "48725",
"producttype": "NORMAL",
"symbol": "COCUDAKL",
"instrumenttype": "FUTCOM",
"series": "XX",
"strikeprice": -1,
"optiontype": "XX",
"expirydate": "20/01/2022",
"lotsize": 10,
"precision": 2,
"multiplier": 10,
"tradeprice": 278400,
"tradeqty": 20,
"tradevalue": 5568000,
"buyorsell": "Sell",
"orderid": "112000321",
"tradeno": "12343",
"tradetime": "10/01/2022",
"uniqueorderid": "2700002AA020",
},
{...}...
]
}