Skip to content

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

NameTypeRequiredDescription
symbolNamestringtruePass "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).
exchangestringtrueName 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.
transactionTypestringtrueTransaction type should be BUY or SELL.
orderTypestringtrueType of order. It can be one of the following: L - Limit Order, SL - Stop Loss Limit.
quantitystringtrueQuantity with which the order is being placed.
disclosedQuantitystringfalseIf provided, should be a minimum of 10% of the actual quantity.
pricestringfalsePrice mandatory when order type is L (Limit Order) or SL (Stop Loss Limit).
orderValiditystringtrueOrder 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.
afterMarketOrderFlagstringfalseAfter Market Order Flag YES/NO.
productTypestringtrueProduct Type of the order. It can be CNC (Cash and Carry), NRML (Normal), MIS (Intraday), CO (Cover Order), BO (Bracket Order).
triggerPricestringfalseThe price at which an order should be triggered in case of SL.

Sample Request Body

json
requestBody={ 
"symbolName":"IDEA",
"exchange":"NSE",
"transactionType":"BUY",
"orderType":"L",
"quantity": "1",
"disclosedQuantity":"1",
"orderValidity":"DAY",
"productType":"CNC",
"afterMarketOrderFlag":"NO",
"price":"13.40"
}
json
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

bash
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"}'
java
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());
  }
}
js
(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);
})();
py
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.

json
{
    "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

NameTypeDescription
serverTimestringTime at Server.
msgIdstringThis 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.
orderNumberstringUnique Order identifier generated after placing an order which could be used for tracking order status.
statusstringStatus of the order. It would be success or failure.
statusMessagestringOrder placement status Message.
exchangeOrderStatusstringStatus of the order execution at Exchange side. Most common values are PENDING, COMPLETE, REJECTED, CANCELLED, and OPEN.
rejectionReasonstringIf an order is rejected, cause of order rejection which comes as user-friendly textual description.
orderDetailsobjectnone
pendingQuantitystringQuantity which is in waiting state to be filled in a specific trade.
avgExecutionPricestringAverage price at which the quantities were bought/sold during the day.
orderPlacedBystringClient code of the user who placed the order.
tradingSymbolstringTrading Symbol of the scrip.
triggerPricestringThe price at which an order should be triggered in case of SL.
exchangestringName 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.
totalQuantitystringTotal Quantity.
expirystringExpiry date of trading symbol.
transactionTypestringType of the transaction, BUY / SELL.
productTypestringProduct 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).
orderTypestringType of order user has placed. It can be one of the following: L - Limit Order, SL - Stop Limit.
quantitystringOrder Quantity as placed by the user.
filledQuantitystringQuantity which is filled in a specific trade. Can be less than or equal to the total quantity.
orderPricestringLimit price entered at the time of placing the order.
filledPricestringPrice at which exchange has filled the order.
exchangeOrderNostringOrder identifier at the exchange.
orderValiditystringValidity of the order.
orderTimestringOrder placement time.