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
| Name | Type | Required | Description |
|---|---|---|---|
orderNumber | string | true | Order 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
| 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 number generated at the exchange while placing an order. |
orderStatus | string | Status of the order at the Exchange side. Most common values are PENDING, COMPLETE, REJECTED, CANCELLED, and OPEN. |
statusMessage | string | Status message of the order. |
orderDetails | object | none. |
pendingQuantity | string | Quantity which is in a 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 the case of SL. |
exchange | string | Name 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. |
totalQuantity | string | Total quantity. |
expiry | string | Expiry date of the trading symbol. |
transactionType | string | Type of the transaction, BUY / SELL. |
productType | string | Product 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). |
orderType | string | Type of order the user has placed. It can be one of the following: L (Limit Order), SL (Stop Loss Limit). |
quantity | string | Order quantity as placed by the user. |
filledQuantity | string | Quantity 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 the exchange has filled the order. |
exchangeOrderNo | string | Order identifier at the exchange. |
orderValidity | string | Validity of the order. |
orderTime | string | Order placement time. |