Skip to content

Get Order Status

GET /order/getOrderStatus

Get status of an order placed previously. This API returns all states of the orders,but not limited to open, pending, and partially filled ones.

Parameters

NameTypeRequiredDescription
orderNumberstringtrueOrder Number for which the user wants to check the order status

Sample Code

bash
curl -X GET 'https://tradeapi.samco.in/order/getOrderStatus?orderNumber=190707000000004' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-session-token: <SESSION_TOKEN>'
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 {
    HttpClient client = HttpClient.newHttpClient();

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://tradeapi.samco.in/order/getOrderStatus?orderNumber=190707000000004"))
        .header("Content-Type", "application/json")
        .header("Accept", "application/json")
        .header("x-session-token", "<SESSION_TOKEN>")
        .GET()
        .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 response = await fetch('https://tradeapi.samco.in/order/getOrderStatus?orderNumber=190707000000004', {
    method: 'GET',
    headers,
  });

  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>',
}

r = requests.get('https://tradeapi.samco.in/order/getOrderStatus?orderNumber=190707000000004',
  headers=headers)

print(r.json())

Sample Responses

json
{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "orderNumber": "190722000000243",
  "orderStatus": "Success",
  "statusMessage": "Requested MIS Order placed successfully",
  "orderDetails": {
    "pendingQuantity": "0",
    "avgExecutionPrice": "1193.00",
    "orderPlacedBy": "DV9999",
    "tradingSymbol": "RELIANCE",
    "triggerPrice": "0.00",
    "exchange": "BSE",
    "totalQuantity": "1",
    "expiry": "--",
    "transactionType": "BUY",
    "productType": "MIS",
    "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 number generated at the exchange while placing an order.
orderStatusstringStatus of the order at the Exchange side. Most common values are PENDING, COMPLETE, REJECTED, CANCELLED, and OPEN.
statusMessagestringStatus message of the order.
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. It can be CNC (Cash and Carry), BO (Bracket Order), CO (Cover Order), NRML (Normal), or MIS (Intraday).
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.