Skip to content

TriggerOrders

GET /order/getTriggerOrders

This API allows you to get the trigger order numbers in case of BO and CO orders so that their attribute values can be modified for BO orders, it will give the order identifiers. For Stop loss leg and target leg. Similarly for CO orders, it will return order identifier of stop loss leg only. Using the order identifier, the user would be able to modify the order attributes using the modifyOrder API. Refer modifyOrder API documentation for the parameters details.

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/getTriggerOrders?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/getTriggerOrders?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/getTriggerOrders?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/getTriggerOrders?orderNumber=190707000000004',
  headers=headers)

print(r.json())

Sample Responses

json
{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "status": "Success",
  "statusMessage": "SubOrder details retrieved successfully.",
  "triggerOrders": [
    {
      "stopLossOrderNo": "191219000000063",
      "orderStatus": "Complete",
      "orderPrice": "351.20",
      "triggerPrice": "331.20"
    }
  ]
}

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.
statusstringResponse status. Can be Success or Failure.
statusMessagestringStatus Message.
triggerOrders[object]Trigger order details available for the provided OrderNumber.
stopLossOrderNostringUnique Order identifier generated from the exchange.
orderStatusstringStatus of the order at the Exchange side, either executed successfully, complete, trigger pending, or cancelled.
orderPricestringPrice of a particular order.
triggerPricestringThe price at which an order should be triggered.