Skip to content

Place CO Order

POST /order/placeOrderCO

This API allows you to place an equity/derivative order to the exchange i.e the place order request typically registers the order with OMS and when it happens successfully, a success response is returned. Successful placement of an order via the API does not imply its successful execution. To be precise, under normal scenarios, the whole flow of order execution starting with order placement, routing to OMS and transfer to the exchange, order execution, and confirmation from exchange happen real time. But due to various reasons like market hours, exchange related checks etc. This may not happen instantly. So when an order is successfully placed the placeOrder API returns an orderNumber in response, and in scenarios as above the actual order status can be checked separately using the orderStatus API call. This is for Placing CO Orders.

In the BFO exchange, only SENSEX and BANKEX trades are allowed.

Parameters

NameTypeRequiredDescription
bodyobjectfalsenone
symbolNamestringtruePass "name" in the symbolName parameter for Equity Cash symbols and "Trading Symbol" for all the F&O contracts ('name' and 'tradingSymbol' are available in ScripMaster.csv).
exchangestringtrueName of the exchange. Valid exchange values are BSE, NSE, NFO, MCX, and CDS. If the user does not provide an exchange name, the default is NSE. For trading with BSE, NFO, CDS, and MCX, the exchange is mandatory.
transactionTypestringtrueTransaction type should be either BUY or SELL.
orderTypestringtrueType of order. It can be one of the following: L (Limit Order).
quantitystringtrueQuantity with which the order is being placed.
disclosedQuantitystringtrueIf provided, it should be a minimum of 10% of the actual quantity.
pricestringtruePrice at which the order will be placed.
orderValiditystringtrueOrder validity should be DAY. DAY is an order type which is valid for the whole trading day and stays pending until it is executed within the respective trading day.
productTypestringtrueProduct type of the order. It can be CO (Cover Order).
triggerPricestringfalseThe price at which an order should be triggered.

Sample Request Body

json
requestBody={
  "symbolName": "RELIANCE",
  "exchange": "BSE",
  "transactionType": "BUY",
  "orderType": "L",
  "quantity": "1",
  "disclosedQuantity": "1",
  "price": "1240.0",
  "orderValidity": "DAY",
  "productType": "CO",
  "triggerPrice": "1070.00"
}

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.

Sample Code

bash
curl -X POST 'https://tradeapi.samco.in/order/placeOrderCO' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-session-token: <SESSION_TOKEN>' \
  -d '{"symbolName":"RELIANCE","exchange":"BSE","transactionType":"BUY","orderType":"L","quantity":"1","disclosedQuantity":"1","price":"1240.0","orderValidity":"DAY","productType":"CO","triggerPrice":"1070.00"}'
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": "RELIANCE",
          "exchange": "BSE",
          "transactionType": "BUY",
          "orderType": "L",
          "quantity": "1",
          "disclosedQuantity": "1",
          "price": "1240.0",
          "orderValidity": "DAY",
          "productType": "CO",
          "triggerPrice": "1070.00"
        }
        """;

    HttpClient client = HttpClient.newHttpClient();

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://tradeapi.samco.in/order/placeOrderCO"))
        .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: "RELIANCE",
    exchange: "BSE",
    transactionType: "BUY",
    orderType: "L",
    quantity: "1",
    disclosedQuantity: "1",
    price: "1240.0",
    orderValidity: "DAY",
    productType: "CO",
    triggerPrice: "1070.00"
  };

  const response = await fetch('https://tradeapi.samco.in/order/placeOrderCO', {
    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": "RELIANCE",
  "exchange": "BSE",
  "transactionType": "BUY",
  "orderType": "L",
  "quantity": "1",
  "disclosedQuantity": "1",
  "price": "1240.0",
  "orderValidity": "DAY",
  "productType": "CO",
  "triggerPrice": "1070.00"
}

r = requests.post('https://tradeapi.samco.in/order/placeOrderCO',
  data=json.dumps(requestBody),
  headers=headers)

print(r.json())

Sample Responses

json
{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "orderNumber": "190726000001077",
  "status": "Success",
  "exchangeOrderStatus": "Executed",
  "rejectionReason": "--",
  "statusMessage": "CO Order request placed successfully",
  "orderDetails": {
    "pendingQuantity": "0",
    "avgExecutionPrice": "1193.00",
    "orderPlacedBy": "DV9999",
    "tradingSymbol": "RELIANCE",
    "triggerPrice": "0.00",
    "exchange": "BSE",
    "totalQuantity": "1",
    "expiry": "--",
    "transactionType": "BUY",
    "productType": "CO",
    "orderType": "L",
    "quantity": "1",
    "filledQuantity": "1",
    "orderPrice": "1240.00",
    "filledPrice": "1240.0",
    "exchangeOrderNo": "1565067682526005486",
    "orderValidity": "DAY",
    "orderTime": "12/12/2019 16:20:09"
  }
}

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.
exchangeOrderStatusstringStatus of the order execution at the Exchange side. Most common values are PENDING, COMPLETE, REJECTED, CANCELLED, and OPEN.
rejectionReasonstringIf an order is rejected, the cause of order rejection, which comes as a user-friendly textual description.
statusMessagestringOrder placement status message.
orderDetailsobjectnone.
pendingQuantitystringQuantity which is in a 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 the case of SL.
exchangestringName of the exchange. Valid exchange values are BSE, NSE, NFO, MCX, and CDS. If not provided, the default is NSE. For trading with BSE, NFO, CDS, and MCX, the exchange is mandatory.
totalQuantitystringTotal quantity.
expirystringExpiry date of the trading symbol.
transactionTypestringType of the transaction, BUY / SELL.
productTypestringProduct type of the order as placed by the user is CO (Cover Order).
orderTypestringType of order the user has placed. It can be one of the following: L (Limit Order), SL (Stop Loss Limit).
quantitystringOrder quantity as placed by the user.
filledQuantitystringQuantity 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 the exchange has filled the order.
exchangeOrderNostringOrder identifier at the exchange.
orderValiditystringValidity of the order.
orderTimestringOrder placement time.