Place Order V3 Beta
This is an enhanced version of the Place Order API, featuring an auto-slicing capability to break down large orders into smaller sizes bases on the freeze quantity of the instrument. You can enable or disable this feature by setting the slice
flag in your order. For more details, please refer to the Auto Slicing
This API also includes latency information in the meta object of the response, providing insight into the time Upstox took to process your request.
- When slicing is applicable, A maximum of 25 orders can be placed in a single request. Any request exceeding this limit will be rejected.
- When slicing is applicable, Brokerage will be charged for each individual sliced order.
- Currently product type
OCO
is not allowed. - In adherence to CDSL regulations, customers without a DDPI/POA are obligated to use a combination of the CDSL TPIN and OTP to provide the necessary authorization for the deduction of securities from their demat account when engaging in delivery sale transactions.
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Content-Type | true | string | Indicates the media type of the resource, set as application/json . |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Request Body
{
"quantity": 1,
"product": "D",
"validity": "DAY",
"price": 0,
"tag": "string",
"instrument_token": "NSE_EQ|INE848E01016",
"order_type": "MARKET",
"transaction_type": "BUY",
"disclosed_quantity": 0,
"trigger_price": 0,
"is_amo": false,
"slice": true
}
Name | Required | Type | Description |
---|---|---|---|
slice | false | boolean | When true , the number of orders is calculated based on the freeze quantity assigned for the instrument by the exchange. This helps automatically split the order into smaller parts in accordance with exchange rules, preventing rejection due to exceeding the allowed quantity. The default value is false . For a detailed explanation, please check the Auto Slicing section. When slicing is applied, we calculate the total number of resulting orders. The total number of orders generated by the slice, must not exceed the maximum order count specified here. |
For all other fields, please refer to the Place Order API documentation as all fields are the same as those used when placing an order using the Place Order API.
- 200
- 4XX
Response Body
{
"status": "success",
"data": {
"order_ids": [
"1644490272000",
"1644490272001",
"1644490272003"
]
},
"metadata": {
"latency": 30
}
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Typically success for successful operations. |
data | object | Response data for place order request. |
data.order_ids | array | List of reference order IDs associated with successful order placed. |
metadata | object | Order metadata associated with successful order placed. |
metadata.latency | integer | The overall time taken by API platform to process the order request, measured in milliseconds. |
Error codes
Error code | Description |
---|---|
UDAPI1026 | Instrument key is required - You need to provide the instrument key for this operation. |
UDAPI1004 | Valid order type is required - Please ensure to provide a recognized order type. |
UDAPI1056 | The 'order_type' is invalid - The specified order type isn't acceptable. |
UDAPI1057 | The 'transaction_type' is invalid - The given transaction type is not valid. |
UDAPI1006 | Product is required - You must specify the product in your request. |
UDAPI1054 | The 'product' is invalid - The provided product value doesn't match any accepted values. |
UDAPI1007 | Validity is required - You need to provide the duration the order will remain in effect. |
UDAPI1055 | The 'validity' is invalid - The specified order validity isn't recognized. |
UDAPI1008 | Price is required - Please specify the price in your request. |
UDAPI100049 | Access to this API has been restricted for your account. Please use 'Uplink Business' to place/modify/cancel the order. - Use 'Uplink Business' for order operations. |
UDAPI1052 | The order 'quantity' cannot be zero - You cannot set the order quantity to zero. |
UDAPI1040 | Price not required - You shouldn't specify a price for this type of order. |
UDAPI1043 | The 'price' is required - A valid price value needs to be provided for this order type. |
UDAPI1041 | The 'price' and 'trigger_price' both are required - Ensure to specify both price values in your request. |
UDAPI1042 | Only 'trigger_price' is required - Only the trigger price needs to be provided, not the regular price. |
UDAPI1037 | Trigger price should be less than limit price - Ensure your trigger price is set below the limit price. |
UDAPI1038 | Trigger price should be greater than limit price - The trigger price should exceed the limit price value. |
UDAPI100011 | Invalid Instrument key - The instrument key you provided doesn't match any recognized keys. |
UDAPI100039 | AMO orders cannot be placed during the market hours - After Market Order (AMO) is not valid during active market sessions. |
UDAPI100074 | The Place order API is accessible from 5:30 AM to 12:00 AM IST daily - Thrown when an Place Order API is called between midnight and 5:30 AM in the morning. |
UDAPI1118 | Maximum order limit exceeded - When slicing enabled, the number of orders in this request exceeds the maximum allowed count. Requests with more than the permissible limit of orders will be rejected immediately. |
UDAPI1119 | tag length exceeds limit - The length of the tag exceeds the permitted limit of 40 characters. Ensure each tag is within the defined limit. |
The Place order api is down for maintenance from 12:00 AM to 5:30 AM IST daily and is not available for usage during these hours. Users are advised to plan their activities accordingly.
Auto Slicing
Exchanges enforce a limitation on the maximum quantity that can be placed for any scrip, known as the freeze quantity. If an order exceeds this freeze quantity, it will be rejected by the exchange. To simplify the process and prevent such rejections, we automatically slice the order into smaller parts based on the freeze quantity defined by the exchange when necessary.
How to Enable Slicing
To enable this feature, include the slice
field in your request payload with the value set to true
. Let's walk through a practical example:
Suppose you want to place an order for SCRIP1 with a total quantity of 10,100, and the freeze quantity defined by the exchange is 1,000. If you send the slice
field as false
, the entire order is submitted to the exchange, which will reject it due to exceeding the allowed quantity. However, if you pass true
as the value for the slice
field, we automatically split the order into 11 smaller orders: 10 orders of 1,000 units each, and 1 order of 100 units. This ensures that all orders are accepted and processed by the exchange.
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.