Bulk Order
POST /order/bulkOrder
The Bulk Order API is intended for placing large orders that surpass the exchange's standard freeze quantity limits. This API is particularly useful when you need to execute significant trades that would otherwise exceed the usual quantity restrictions imposed by trading platforms. It allows traders to efficiently handle substantial orders by either exceeding the freeze quantity or within it, depending on the order's size and requirements.
In the BFO exchange, only SENSEX and BANKEX trades are allowed.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
symbolName | string | true | Pass "name" in "symbolName" parameter for Equity Cash symbols and "Trading Symbol" for all the F&O contracts ('name' and 'tradingSymbol' is available in ScripMaster.csv). |
exchange | string | true | Name of the exchange. Valid exchanges values (BSE/ NSE/ NFO/ BFO/ MCX/ CDS). If the user does not provide an exchange name, by default considered as NSE. For trading with BSE, NFO, BFO, CDS and MCX, exchange is mandatory. |
transactionType | string | true | Transaction type should be BUY or SELL. |
orderType | string | true | Type of order. It can be one of the following: L - Limit Order, SL - Stop Loss Limit. |
quantity | string | true | Quantity with which the order is being placed. |
disclosedQuantity | string | false | If provided, should be a minimum of 10% of the actual quantity. |
price | string | false | Price mandatory when order type is L (Limit Order) or SL (Stop Loss Limit). |
orderValidity | string | true | Order validity can be DAY / IOC. DAY is an order type which is valid for the whole trading day and stays pending till it is executed in the respective trading day. IOC (Immediate Or Cancel) order type is where once the user punches the order, the order hits the exchange and if not executed immediately, the order stands cancelled. |
afterMarketOrderFlag | string | false | After Market Order Flag YES/NO. |
productType | string | true | Product Type of the order. It can be CNC (Cash and Carry), NRML (Normal), MIS (Intraday), CO (Cover Order), BO (Bracket Order). |
triggerPrice | string | false | The price at which an order should be triggered in case of SL. |
Sample Request Body
requestBody={
"symbolName":"IDEA",
"exchange":"NSE",
"transactionType":"BUY",
"orderType":"L",
"quantity": "1",
"disclosedQuantity":"1",
"orderValidity":"DAY",
"productType":"CNC",
"afterMarketOrderFlag":"NO",
"price":"13.40"
}requestBody={
"symbolName":"IDEA",
"exchange":"NSE",
"transactionType":"BUY",
"orderType":"SL",
"quantity": "1",
"orderValidity":"DAY",
"productType":"CNC",
"price":"13.40",
"triggerPrice":"14.9"
}Live trading endpoint
This sample sends a real request against your trading account. Replace <SESSION_TOKEN> and review every field before running — Samco does not provide a sandbox, and any successful call affects live positions and balances.
Code Sample
curl -X POST 'https://tradeapi.samco.in/order/bulkOrder' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-session-token: <SESSION_TOKEN>' \
-d '{"symbolName":"IDEA","exchange":"NSE","transactionType":"BUY","orderType":"L","quantity":"1","disclosedQuantity":"1","orderValidity":"DAY","productType":"CNC","afterMarketOrderFlag":"NO","price":"13.40"}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Sample {
public static void main(String[] args) throws Exception {
String requestBody = """
{
"symbolName": "IDEA",
"exchange": "NSE",
"transactionType": "BUY",
"orderType": "L",
"quantity": "1",
"disclosedQuantity": "1",
"orderValidity": "DAY",
"productType": "CNC",
"afterMarketOrderFlag": "NO",
"price": "13.40"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://tradeapi.samco.in/order/bulkOrder"))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("x-session-token", "<SESSION_TOKEN>")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}(async () => {
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-session-token': '<SESSION_TOKEN>',
};
const requestBody = {
symbolName: "IDEA",
exchange: "NSE",
transactionType: "BUY",
orderType: "L",
quantity: "1",
disclosedQuantity: "1",
orderValidity: "DAY",
productType: "CNC",
afterMarketOrderFlag: "NO",
price: "13.40"
};
const response = await fetch('https://tradeapi.samco.in/order/bulkOrder', {
method: 'POST',
headers,
body: JSON.stringify(requestBody),
});
const data = await response.json();
console.log(data);
})();import requests
import json
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-session-token': '<SESSION_TOKEN>',
}
requestBody = {
"symbolName": "IDEA",
"exchange": "NSE",
"transactionType": "BUY",
"orderType": "L",
"quantity": "1",
"disclosedQuantity": "1",
"orderValidity": "DAY",
"productType": "CNC",
"afterMarketOrderFlag": "NO",
"price": "13.40"
}
r = requests.post('https://tradeapi.samco.in/order/bulkOrder',
data=json.dumps(requestBody),
headers=headers)
print(r.json())Sample Responses
The response will be consistent across all order types.
{
"serverTime": "22/08/24 15:28:44",
"msgId": "88f189f9-28da-431c-b7dc-3b5e673d4fb0",
"status": "Success",
"orders": [
{
"orderNumber": "240822000136560",
"orderStatus": "REJECTED",
"rejectionReason": "Your order was rejected since you can't place intraday orders in the last half hour of trade as intraday square off's are initiated by the RMS System in this period. All MIS / BO / CO orders shall be rejected during square off block period.",
"orderDetails": {
"pendingQuantity": 0,
"avgExecutionPrice": "0.00",
"orderPlacedBy": "--",
"tradingSymbol": "NIFTY2482224500PE",
"triggerPrice": "0.00",
"exchange": "NFO",
"totalQuantity": 1800,
"transactionType": "BUY",
"productType": "MIS",
"orderType": "L",
"quantity": 1800,
"filledQuantity": 0,
"orderPrice": "17.40",
"filledPrice": "0.00",
"orderValidity": "DAY",
"orderTime": "22/08/2024 15:28:44"
}
},
{
"orderNumber": "240822000136562",
"orderStatus": "REJECTED",
"rejectionReason": "Your order was rejected since you can't place intraday orders in the last half hour of trade as intraday square off's are initiated by the RMS System in this period. All MIS / BO / CO orders shall be rejected during square off block period.",
"orderDetails": {
"pendingQuantity": 0,
"avgExecutionPrice": "0.00",
"orderPlacedBy": "--",
"tradingSymbol": "NIFTY2482224500PE",
"triggerPrice": "0.00",
"exchange": "NFO",
"totalQuantity": 200,
"transactionType": "BUY",
"productType": "MIS",
"orderType": "L",
"quantity": 200,
"filledQuantity": 0,
"orderPrice": "17.40",
"filledPrice": "0.00",
"orderValidity": "DAY",
"orderTime": "22/08/2024 15:28:44"
}
}
]
}Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
serverTime | string | Time at Server. |
msgId | string | This is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request. |
orderNumber | string | Unique Order identifier generated after placing an order which could be used for tracking order status. |
status | string | Status of the order. It would be success or failure. |
statusMessage | string | Order placement status Message. |
exchangeOrderStatus | string | Status of the order execution at Exchange side. Most common values are PENDING, COMPLETE, REJECTED, CANCELLED, and OPEN. |
rejectionReason | string | If an order is rejected, cause of order rejection which comes as user-friendly textual description. |
orderDetails | object | none |
pendingQuantity | string | Quantity which is in waiting state to be filled in a specific trade. |
avgExecutionPrice | string | Average price at which the quantities were bought/sold during the day. |
orderPlacedBy | string | Client code of the user who placed the order. |
tradingSymbol | string | Trading Symbol of the scrip. |
triggerPrice | string | The price at which an order should be triggered in case of SL. |
exchange | string | Name of the exchange. Valid exchanges values (BSE/ NSE/ NFO/ MCX/ CDS). If the user does not provide an exchange name, by default considered as NSE. For trading with BSE, NFO, CDS and MCX, exchange is mandatory. |
totalQuantity | string | Total Quantity. |
expiry | string | Expiry date of trading symbol. |
transactionType | string | Type of the transaction, BUY / SELL. |
productType | string | Product Type of order as placed by the user. It can be CNC (Cash and Carry), BO (Bracket Order), CO (Cover Order), NRML (Normal), MIS (Intraday). |
orderType | string | Type of order user has placed. It can be one of the following: L - Limit Order, SL - Stop Limit. |
quantity | string | Order Quantity as placed by the user. |
filledQuantity | string | Quantity which is filled in a specific trade. Can be less than or equal to the total quantity. |
orderPrice | string | Limit price entered at the time of placing the order. |
filledPrice | string | Price at which exchange has filled the order. |
exchangeOrderNo | string | Order identifier at the exchange. |
orderValidity | string | Validity of the order. |
orderTime | string | Order placement time. |