Basket Order¶
A Basket Order allows traders or investors to group multiple stock orders (scrips) into a single executable unit. This is useful for executing a predefined investment strategy quickly and efficiently without manually placing each trade.
Type | API Endpoint | Description |
---|---|---|
POST | basketorder/create |
Creates a new basket order with a specified name and configuration. |
GET | basketorder/ |
Retrieves a list of all existing basket orders for the user. |
POST | basketorder/rename |
Renames an existing basket order. Requires basket ID and new name. |
DELETE | basketorder/delete/{id} |
Deletes a specific basket order identified by its ID. |
POST | basketorder/add/scrips |
Adds one or more scrips (stocks) to a specific basket order. |
GET | basketorder/get/scrips/{id} |
Retrieves all scrips associated with the specified basket order ID. |
POST | basketorder/delete/scrips |
Removes specific scrips from a basket order. Requires basket ID and scrip IDs. |
Create Basket¶
The Create Basket API allows users to initialize a new basket that can later hold multiple stock or derivative scrips for batch trading. This is the first step in setting up a basket order strategy.
Request Structure
Input parameters
Field | Type | Description |
---|---|---|
basketName | String | Name of the basket |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"basketId": 22,
"basketName": "Test101 Basket",
"isExecuted": "0",
"createdOn": "2025-04-30T05:56:28.586+00:00",
"scripCount": 1
},
{
"basketId": 23,
"basketName": "Equity",
"isExecuted": "0",
"createdOn": "2025-04-30T05:58:24.942+00:00",
"scripCount": 2
},
{
"basketId": 107,
"basketName": "Basket 3",
"isExecuted": "0",
"createdOn": "2025-06-20T09:37:40.485+00:00",
"scripCount": 0
}
]
}
Parameters
Field | Type | Description |
---|---|---|
basketId | Int | Order specific identification generated |
basketName | String | Name of the basket |
isExecuted | String | Status of basket execution |
createdOn | String | Date and time when the basket was created |
scripCount | Int | Number of scrips in the basket |
Get Basket Order¶
The Get Basket Order API retrieves all baskets created by a user, including metadata like basket name, ID, and optionally status or timestamp.
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"basketId": 9180,
"basketName": "nifty",
"isExecuted": "0",
"createdOn": "2023-08-28 10:06:01",
"scripCount": 1
},
{
"basketId": 19998,
"basketName": "BANKNIFTY_28SEP23_2709",
"isExecuted": "0",
"createdOn": "2023-09-27 13:56:19",
"scripCount": 0
}
]
}
Parameters
Field | Type | Description |
---|---|---|
basketId | String | Order specific identification generated |
basketName | String | Name of the basket |
isExecuted | String | Status of basket execution (0 for not executed, 1 for executed) |
createdOn | String | Date and time when the basket was created |
scripCount | Int | Number of scrips in the basket |
Rename Basket¶
The Rename Basket Order API allows a user to update the name of an existing basket order.
Request Structure
Input parameters
Field | Type | Description |
---|---|---|
basketId | String | Order specific identification generated |
basketName | String | Name of the basket |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"basketId": 22,
"basketName": "Test101 Basket",
"isExecuted": "0",
"createdOn": "2025-04-30T05:56:28.586+00:00",
"scripCount": 1
},
{
"basketId": 23,
"basketName": "BankNifty",
"isExecuted": "0",
"createdOn": "2025-04-30T05:58:24.942+00:00",
"scripCount": 2
},
{
"basketId": 107,
"basketName": "Basket 3",
"isExecuted": "0",
"createdOn": "2025-06-20T09:37:40.485+00:00",
"scripCount": 0
}
]
}
Parameters
Field | Type | Description |
---|---|---|
basketId | integer | Unique identifier for the basket |
basketName | string | User-defined name of the basket |
isExecuted | string | "1" if the basket has been executed, "0" if not |
createdOn | datetime | Timestamp of when the basket was created (ISO 8601 format) |
scripCount | integer | Number of scrips (stocks/instruments) currently added in the basket |
Add Scrip to Basket¶
Add one or more scrips (stocks, contracts, instruments) to a specific basket order.
Request Structure
{
"basketId": 23,
"scrips": {
"exchange": "BSE",
"token": "440001",
"qty": "1",
"price": "686513",
"transType": "B",
"product": "NRML",
"priceType": "L",
"orderType": "Regular",
"ret": "DAY",
"triggerPrice": "",
"disclosedQty": "",
"mktProtection": "",
"target": "",
"stopLoss": "",
"trailingStopLoss": ""
}
}
Input parameters
Field | Type | Description |
---|---|---|
basketId | integer | Unique ID of the basket to which the scrip is being added |
scrips | object | Object containing the details of the scrip/instrument |
exchange | string | Exchange code (e.g., "NSE", "BSE", "MCX") |
token | string | Unique token or ID for the instrument/scrip |
qty | string | Quantity of the instrument to be traded |
price | string | Price at which the order is to be placed |
transType | string | Transaction type: "B" for Buy, "S" for Sell |
product | string | Product type: "CNC", "MIS", "NRML", etc. |
priceType | string | Order price type: "L" (Limit), "MKT" (Market), etc. |
orderType | string | Order category: e.g., "Regular", "AMO" |
ret | string | Order validity: "DAY", "IOC", etc. |
triggerPrice | string | Trigger price for Stop Loss or SL-M order types (if applicable) |
disclosedQty | string | Disclosed quantity (optional; portion of qty shown to market) |
mktProtection | string | Market protection price (for market orders with price cap; optional) |
target | string | Target price (optional, for advanced strategy orders) |
stopLoss | string | Stop-loss price (optional, for advanced strategy orders) |
trailingStopLoss | string | Trailing SL value (optional, for trailing SL strategy) |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"id": 345,
"basketId": 23,
"sortOrder": null,
"exchange": "NSE",
"token": "22",
"tradingSymbol": "ACC-EQ",
"qty": "1",
"price": "686513",
"expiry": null,
"product": "NRML",
"transType": "B",
"priceType": "L",
"orderType": "Regular",
"ret": "DAY",
"triggerPrice": "",
"disClosedQty": null,
"mktProtection": "",
"target": "",
"stopLoss": "",
"trailingStopLoss": "",
"formattedInsName": "ACC-EQ",
"weekTag": "",
"validityDays": null,
"expiryDate": null
}
]
}
Parameters
Field | Type | Description |
---|---|---|
id | integer | Unique ID for the specific scrip entry in the basket |
basketId | integer | ID of the basket this scrip belongs to |
sortOrder | null/integer | Order in which the scrip appears in the basket (optional) |
exchange | string | Exchange where the order will be placed (e.g., "NSE", "BSE") |
token | string | Unique token/identifier for the instrument |
tradingSymbol | string | Tradable symbol of the stock (e.g., "ACC-EQ") |
qty | string | Quantity of shares to be bought or sold |
price | string | Order price for limit orders |
expiry | null/string | Expiry date for F\&O instruments, if applicable |
product | string | Product type (e.g., "NRML", "MIS", "CNC") |
transType | string | Transaction type: "B" for Buy, "S" for Sell |
priceType | string | Price type: "L" for Limit, "MKT" for Market |
orderType | string | Order type: "Regular", "Cover", "Bracket" etc. |
ret | string | Order validity: "DAY", "IOC" etc. |
triggerPrice | string | Trigger price for Stop-Loss or SL-M orders (empty if not applicable) |
disClosedQty | null/string | Disclosed quantity (part of total quantity shown to market; optional) |
mktProtection | string | Market protection price for market orders with bounds (optional) |
target | string | Target price for bracket/advanced orders (optional) |
stopLoss | string | Stop-loss value for bracket/advanced orders (optional) |
trailingStopLoss | string | Trailing SL value (optional) |
formattedInsName | string | Formatted instrument name for display (e.g., "ACC-EQ") |
weekTag | string | Additional tag used for weekly options contracts (empty if not applicable) |
validityDays | null/integer | Validity in days if custom duration is used |
expiryDate | null/string | Expiry date for derivatives, if applicable |
Get Retrieve Scrips¶
This API retrieves the list of trading instruments (scrips) associated with a particular basket. Each scrip includes complete order parameters such as symbol, quantity, price, transaction type, and order details
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"id": 79,
"basketId": 23,
"sortOrder": null,
"exchange": "NSE",
"token": "1594",
"tradingSymbol": "INFY-EQ",
"qty": "1",
"price": "1480.20",
"expiry": null,
"product": "CNC",
"transType": "B",
"priceType": "L",
"orderType": "Regular",
"ret": "DAY",
"triggerPrice": "0",
"disClosedQty": null,
"mktProtection": "",
"target": "0",
"stopLoss": "0",
"trailingStopLoss": "0",
"formattedInsName": "INFY-EQ",
"weekTag": null,
"validityDays": null,
"expiryDate": null
},
{
"id": 80,
"basketId": 23,
"sortOrder": null,
"exchange": "NSE",
"token": "20481",
"tradingSymbol": "WIPL-EQ",
"qty": "1",
"price": "148.80",
"expiry": null,
"product": "CNC",
"transType": "B",
"priceType": "L",
"orderType": "Regular",
"ret": "DAY",
"triggerPrice": "0",
"disClosedQty": null,
"mktProtection": "",
"target": "0",
"stopLoss": "0",
"trailingStopLoss": "0",
"formattedInsName": "WIPL-EQ",
"weekTag": null,
"validityDays": null,
"expiryDate": null
}
]
}
Parameters
Field | Description |
---|---|
id | Unique identifier for the basket scrip entry. |
basketId | ID of the basket this scrip belongs to. |
exchange | Exchange on which the order will be placed (e.g., NSE, BSE). |
token | Internal token or code representing the instrument. |
tradingSymbol | The symbol of the stock/instrument (e.g., INFY-EQ). |
qty | Quantity of shares/contracts to be ordered. |
price | Limit price at which the order will be placed. |
expiry | Expiry date for derivatives (if applicable). |
product | Order product type (CNC, NRML, etc.). |
transType | Order side: "B" for Buy, "S" for Sell. |
priceType | Type of pricing: "L" for Limit, "MKT" for Market. |
orderType | Type of order (e.g., Regular, Bracket, etc.). |
ret | Order validity: DAY, IOC, etc. |
triggerPrice | Trigger price for stop-loss orders (if applicable). |
disClosedQty | Disclosed quantity to the exchange (optional). |
mktProtection | Market protection points (for market orders, optional). |
target | Target price for profit booking (Bracket order only). |
stopLoss | Stop loss price (Bracket order only). |
trailingStopLoss | Value for trailing stop loss. |
formattedInsName | User-friendly display name for the instrument. |
weekTag | Week tag (for weekly options, if applicable). |
validityDays | Custom number of days for validity (for GTD orders, optional). |
expiryDate | Date of expiry (used for options/futures contracts). |
Delete Scrip in Basket¶
This API is used to remove one or more scrips (stock/instrument entries) from a specific basket. It's typically used when a user wants to modify their basket by eliminating selected orders before executing or saving.
Request Structure
Input parameters
Field | Type | Description |
---|---|---|
basketId | Int | Identifier for the basket |
scripsId | List | List of identifiers for the basket scrips |
Response Structure
{
"status": "Ok",
"message": "Success",
"result": [
{
"id": 27188,
"basketId": 9180,
"sortOrder": null,
"exchange": "NSE",
"token": "2885",
"tradingSymbol": "RELIANCE-EQ",
"qty": "1",
"price": "0",
"expiry": null,
"product": "MIS",
"transType": "B",
"priceType": "MKT",
"orderType": "Regular",
"ret": "DAY",
"triggerPrice": "",
"disClosedQty": null,
"mktProtection": "",
"target": "",
"stopLoss": "",
"trailingStopLoss": "",
"formattedInsName": "RELIANCE-EQ",
"weekTag": null,
"lotSize": "1"
}
]
}
Parameters
Field | Type | Description |
---|---|---|
id | String | Identifier for the basket scrip |
basketId | Int | Identifier for the parent basket |
sortOrder | String | Sorting order |
exchange | String | Exchange where the instrument is traded |
token | String | Token representing the instrument |
tradingSymbol | String | Trading symbol of the instrument |
qty | String | Quantity to be traded |
price | String | Price of the instrument (0 for market orders) |
expiry | String | Expiry date |
product | String | Product code (MIS, NRML, CNC, etc.) |
tranType | String | Transaction type (B for Buy, S for Sell) |
priceType | String | Type of price (MKT, LMT, SL, etc.) |
orderType | String | Type of order (Regular, CO, BO, etc.) |
ret | String | Order validity (DAY, IOC, etc.) |
triggerPrice | String | Trigger price for SL or SL-M orders |
disclosedQty | String | Disclosed quantity |
mktProtection | String | Market protection value |
target | String | Target price for the order |
stopLoss | String | Stop loss price for the order |
trailingStopLoss | String | Trailing stop loss value |
formattedInsName | String | Formatted instrument name |
weekTag | String | Week tag |
lotSize | String | Lot size of the instrument |