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
| Name | Type | Required | Description |
|---|---|---|---|
basketId | string | true | The 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
| Name | Type | Description |
|---|---|---|
serverTime | string | The server's timestamp when the response was generated. |
msgId | string | Unique message ID associated with the response. |
status | string | Indicates the success or failure of the API call. |
statusMessage | string | Provides additional information about the status of the API call. |
basketDetails | string | Contains detailed information about the basket order, including executed, pending, and rejected orders. |
deletedContracts | string | Number of contracts that were deleted from the basket. |
finalMargin | string | Final margin amount after all adjustments. |
maxMargin | string | Maximum margin required for the basket order. |
estimatedCharges | string | Estimated charges for executing the basket order. |
notSentToExchange | string | List of contracts not sent to the exchange for execution. |
executed | string | List of executed orders in the basket. |
pending | string | List of pending orders in the basket. |
rejected | string | List of rejected orders in the basket. |
client_id | string | Client ID associated with the basket order. |
basketId | string | Unique ID of the basket. |
basketOrderId | string | Unique ID of the specific order within the basket. |
symName | string | Symbol name of the security. |
symbol | string | Complete symbol code, including the exchange identifier. |
instrumentType | string | Type of financial instrument (e.g., EQ for equity). |
transactionSide | string | Type of transaction (e.g., BUY or SELL). |
orderPrice | string | Price at which the order is placed. |
validity | string | Validity of the order (e.g., DAY). |
orderType | string | Type of order placed. |
quantity | string | Number of shares or contracts in the order. |
productCode | string | Code representing the type of product (e.g., CNC). |
disclosedQuantity | string | Disclosed quantity of the order. |
marginBlocked | string | Margin amount blocked for the order. |
marginRequired | string | Total margin required for the order. |
incrementalMargin | string | Incremental margin required for the order. |
filledQuantity | string | Quantity of the order that has been filled or executed. |
tradingSymbol | string | Trading symbol of the security. |
dispCompanyName | string | Display name of the company associated with the security. |
companyName | string | Full name of the company associated with the security. |
dispExpiryDate | string | Display expiry date for derivatives, if applicable. |
expiry | string | Expiry date of the contract, if applicable. |
instrument | string | Type of instrument (e.g., FUT, OPT, etc.), if applicable. |
dispExc | string | Display exchange code (e.g., BSE). |
dispInstType | string | Display instrument type (e.g., EQ, FUT, OPT, etc.). |
orderStatus | string | Status of the order (e.g., PENDING, EXECUTED, REJECTED). |
stopPrice | string | Stop price for stop-loss orders, if applicable. |
sSLVal | string | Stop-loss value for the order, if applicable. |
sLtpOrAtp | string | Last traded price or average traded price related to stop-loss, if applicable. |
sSLAbsOrTicks | string | Stop-loss in absolute value or ticks, if applicable. |
sSqrOffVal | string | Square-off value for the order, if applicable. |
sSqroffLtpOrAtp | string | Last traded price or average traded price for square-off, if applicable. |
sSqrOffAbsOrTicks | string | Square-off value in absolute or ticks, if applicable. |
sTrailingSL | string | Trailing stop-loss value for the order, if applicable. |
sTrailingSLTicks | string | Trailing stop-loss value in ticks, if applicable. |
rmsOrder | string | RMS (Risk Management System) order ID for tracking the order. |