Skip to content

List Basket Order

GET basket/listBasketOrder

The "List Basket Order" API retrieves and lists all orders associated with a specific basket based on the basket ID provided by the user.

Parameters

NameTypeRequiredDescription
basketIdstringtrueThe main order identifier provided as an input which needs to be exited.

Sample Code

bash
curl -X GET 'https://tradeapi.samco.in/basket/listBasketOrder?basketId=6' \
  -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/basket/listBasketOrder?basketId=6"))
        .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/basket/listBasketOrder?basketId=6', {
    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/basket/listBasketOrder?basketId=6',
  headers=headers)

print(r.json())

Sample Responses

json
{
    "serverTime": "21/08/24 17:27:48",
    "msgId": "87cb63fb-2a49-48bb-af77-b63bedec477d",
    "status": "Success",
    "statusMessage": "Basket order listed successfully",
    "basketDetails": {
        "deletedContracts": 0,
        "finalMargin": "0.00",
        "maxMargin": "0.00",
        "estimatedCharges": "0.00",
        "notSentToExchange": [],
        "executed": [],
        "pending": [],
        "rejected": []
    }
}
json
{
    "serverTime": "21/08/24 17:28:08",
    "msgId": "d91f23c6-be83-4cd1-b2ac-82fefed650c8",
    "status": "Failure",
    "statusMessage": "No such Basket found"
}

Response Schema

Status Code 200

NameTypeDescription
serverTimestringThe server's timestamp when the response was generated.
msgIdstringUnique message ID associated with the response.
statusstringIndicates the success or failure of the API call.
statusMessagestringProvides additional information about the status of the API call.
basketDetailsstringContains detailed information about the basket order, including executed, pending, and rejected orders.
deletedContractsstringNumber of contracts that were deleted from the basket.
finalMarginstringFinal margin amount after all adjustments.
maxMarginstringMaximum margin required for the basket order.
estimatedChargesstringEstimated charges for executing the basket order.
notSentToExchangestringList of contracts not sent to the exchange for execution.
executedstringList of executed orders in the basket.
pendingstringList of pending orders in the basket.
rejectedstringList of rejected orders in the basket.
client_idstringClient ID associated with the basket order.
basketIdstringUnique ID of the basket.
basketOrderIdstringUnique ID of the specific order within the basket.
symNamestringSymbol name of the security.
symbolstringComplete symbol code, including the exchange identifier.
instrumentTypestringType of financial instrument (e.g., EQ for equity).
transactionSidestringType of transaction (e.g., BUY or SELL).
orderPricestringPrice at which the order is placed.
validitystringValidity of the order (e.g., DAY).
orderTypestringType of order placed.
quantitystringNumber of shares or contracts in the order.
productCodestringCode representing the type of product (e.g., CNC).
disclosedQuantitystringDisclosed quantity of the order.
marginBlockedstringMargin amount blocked for the order.
marginRequiredstringTotal margin required for the order.
incrementalMarginstringIncremental margin required for the order.
filledQuantitystringQuantity of the order that has been filled or executed.
tradingSymbolstringTrading symbol of the security.
dispCompanyNamestringDisplay name of the company associated with the security.
companyNamestringFull name of the company associated with the security.
dispExpiryDatestringDisplay expiry date for derivatives, if applicable.
expirystringExpiry date of the contract, if applicable.
instrumentstringType of instrument (e.g., FUT, OPT, etc.), if applicable.
dispExcstringDisplay exchange code (e.g., BSE).
dispInstTypestringDisplay instrument type (e.g., EQ, FUT, OPT, etc.).
orderStatusstringStatus of the order (e.g., PENDING, EXECUTED, REJECTED).
stopPricestringStop price for stop-loss orders, if applicable.
sSLValstringStop-loss value for the order, if applicable.
sLtpOrAtpstringLast traded price or average traded price related to stop-loss, if applicable.
sSLAbsOrTicksstringStop-loss in absolute value or ticks, if applicable.
sSqrOffValstringSquare-off value for the order, if applicable.
sSqroffLtpOrAtpstringLast traded price or average traded price for square-off, if applicable.
sSqrOffAbsOrTicksstringSquare-off value in absolute or ticks, if applicable.
sTrailingSLstringTrailing stop-loss value for the order, if applicable.
sTrailingSLTicksstringTrailing stop-loss value in ticks, if applicable.
rmsOrderstringRMS (Risk Management System) order ID for tracking the order.