pocketful logo light
pocketful logo light

Create Basket

This method is used to create basket. It can create two types of basket i.e. Normal or Hedge. The Hedge Basket helps to hedge margins for all the instruments added in the basket.

Endpoint: /api/v1/basket
Method-Type: POST

Request Packet

{
    "login_id":"clintId",
    "name":"Basket1",
    "type":"NORMAL",
    "product_type":"ALL",
    "order_type":"LIMIT"
}

Parameters

FieldNameDatatypeDescription
login_idStringRepresents the unique id of user or username.
nameStringRepresents the name of the basket.
typeStringNORMALHEDGE
product_typeStringCNCMISNRML
order_typeStringLIMITSL

Example

response = pocket.createBasket(
    {
    "login_id":"clintId",
    "name":"Basket1",
    "type":"NORMAL",
    "product_type":"ALL",
    "order_type":"LIMIT"
    }
)

Response

{
    "data": [{
            "basket_id": "723905f6-b0f6-4bf9-a4f7-b0f119d9e24f",
            "basket_type": "NORMAL",
            "is_executed": false,
            "login_id": "<client id>",
            "name": "Basket1",
            "order_type": "LIMIT",
            "orders": [
                {
                    "order_id": "5829e63e-f83d-423f-9327-37f6c5a0c6b5",
                    "order_info": {
                        "login_id": null,
                        "order_status": null,
                        "rejection_code": 0,
                        "exchange": "NSE",
                        "sl_trigger_price": 0.0,
                        "client_id": "<client id>",
                        "mode": "NEW",
                        "product": "CNC",
                        "rejection_reason": "",
                        "order_side": "BUY",
                        "market_protection_percentage": 0,
                        "nnf_id": 0,
                        "validity": "DAY",
                        "trading_symbol": "VAKRANGEE-EQ",
                        "trigger_price": 0,
                        "is_trailing": false,
                        "series": "EQ",
                        "lot_size": 0,
                        "leg_order_indicator": null,
                        "disclosed_quantity": 0,
                        "order_entry_time": 0,
                        "sl_order_quantity": 0,
                        "order_type": "LIMIT",
                        "average_price": 0,
                        "deposit": 0,
                        "contract_description": {},
                        "average_trade_price": 0,
                        "oms_order_id": "",
                        "filled_quantity": 0,
                        "order_status_info": "",
                        "trailing_stop_loss": null,
                        "price": 10.0,
                        "segment": "",
                        "underlying_token": "13342",
                        "sl_order_price": 0.0,
                        "instrument_token": 13342,
                        "trade_price": 0,
                        "symbol": "",
                        "target_price_type": "absolute",
                        "execution_type": "REGULAR",
                        "quantity": 1,
                        "order_tag": "",
                        "spread_token": null,
                        "isin": "",
                        "pro_cli": "CLIENT",
                        "tags": [],
                        "last_activity_reference": 0,
                        "square_off_value": null,
                        "remaining_quantity": 0,
                        "square_off": false,
                        "stop_loss_value": null,
                        "exchange_order_id": "",
                        "exchange_time": 0,
                        "device": null,
                        "user_order_id": 28483,
                        "source": null
                    }
                }
            ],
            "product_type": "ALL",
            "sip_eligible": true,
            "sip_enabled": false
        }
          ],
    "message": "Basket A_Basket created successfully",
    "status": "success"
}
Field NameDescription
dataContains information about the basket and its associated orders.
basket_idUnique identifier for the basket.
basket_typeType of basket (e.g., NORMAL, HEDGE).
is_executedIndicates if the basket has been executed.
login_idIdentifier for the user’s login.
nameName of the basket.
order_typeType of orders in the basket (e.g., LIMIT).
ordersArray containing details of individual orders within the basket.
order_idUnique identifier for the order.
order_infoInformation about the order.
exchangeExchange where the order is placed.
sl_trigger_priceTrigger price for stop-loss order.
client_idIdentifier for the client.
modeMode of the order (e.g., NEW).
productProduct type (e.g., CNC).
rejection_codeCode for rejection reason.
rejection_reasonReason for rejection.
order_sideSide of the order (e.g., BUY).
market_protection_percentageLimit on price deviation for order placement.
validityValidity of the order (e.g., DAY).
trading_symbolSymbol for the traded security.
trigger_priceTrigger price for the order.
is_trailingIndicates if trailing stop-loss is enabled.
seriesSeries for the order (e.g., EQ).
lot_sizeSize of the trading lot.
leg_order_indicatorIndicator for identifying leg of the order.
disclosed_quantityQuantity disclosed in the order.
order_entry_timeTime at which the order was entered.
sl_order_quantityQuantity for stop-loss order.
order_typeType of order (e.g., LIMIT).
average_priceAverage price of the order.
depositDeposit amount for the order.
contract_descriptionDescription of the contract.
average_trade_priceAverage trade price of the order.
oms_order_idOrder ID assigned by the order management system.
filled_quantityQuantity filled for the order.
order_status_infoAdditional information about the order status.
trailing_stop_lossValue for trailing stop-loss.
pricePrice specified for the order.
segmentSegment of the market.
underlying_tokenToken for the underlying security.
sl_order_pricePrice for stop-loss order.
instrument_tokenToken for the instrument.
trade_pricePrice at which the trade occurred.
symbolSymbol for the order.
target_price_typeType of target price (e.g., absolute).
execution_typeType of execution (e.g., REGULAR).
quantityQuantity of shares in the order.
order_tagTag associated with the order.
spread_tokenToken for the spread.
isinInternational Securities Identification Number (ISIN).
pro_cliType of client (e.g., CLIENT).
tagsAdditional tags associated with the order.
last_activity_referenceReference to the last activity related to the order.
square_off_valueValue for square-off.
remaining_quantityRemaining quantity for the order.
square_offIndicates if square-off is enabled.
stop_loss_valueValue for stop-loss.
exchange_order_idOrder ID assigned by the exchange.
exchange_timeTime at which the order was executed by the exchange.
deviceDevice used for placing the order.
user_order_idUser-specific identifier for the order.
sourceSource of the order.
statusStatus of the operation (e.g., success).
messageDescription of the operation’s outcome.

Error Response

{ 
  data: {}
  error_code: 48001
  message: "name has already been taken"
  status: "error"
}