pocketful logo light
pocketful logo light

Add Basket Instrument

This API used to add Instrument in the created basket. We can add only limited number of instruments in the basket and repeated instrument can’t be added.

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

Request Packet

{
  "basket_id": "9cd5fbc3-333b-4934-8d45-e692349b5ede",
  "name": "Y_Basket",
  "order_info": {
      "client_id": "<client id>",
      "disclosedQuantity": 0,
      "exchange": "NSE",
      "execution_type": "REGULAR",
      "instrument_token": 14366,
      "order_side": "BUY",
      "order_type": "LIMIT",
      "price": 0,
      "product": "MIS",
      "quantity": 1,
      "series": "EQ",
      "trading_symbol": "IDEA-EQ",
      "trigger_price": 0,
      "underlying_token": "14366",
      "validity": "DAY",
      "user_order_id": 10002
  }
}

Parameters

FieldNameDatatypeDescription
basket_idStringRepresents the unique id of basket.
nameStringRepresents the name of the basket.
exchangeStringNSEBSENFOMCX
instrument_tokenIntegerRepresents unique id of a particular instrument.
client_idStringRepresents the unique id of user or username.
order_typeStringLIMITSL
priceStringprice at which order will get placed
productStringCNCMISNRML
disclose_quantityIntegerIt can’t be a negative number.
execution_typeStringREGULARBOCOAMO
order_sideStringBUY or SELL
quantityIntegertotal number of instruments to trade.
seriesStringRepresents the particular series based on exchange.
trading_symbolStringRepresents the name of the instrument.
trigger_priceFloatPrice at which order will get triggered
underlying_tokenIntegerIt is the token of the base equity instrument.
user_order_idIntegerUnique id of the order placed.
validityStringDay or IOC

Example

data = pocket.addInstrumentToBasket({
        "basket_id": "9cd5fbc3-333b-4934-8d45-e692349b5ede",
        "name": "Y_Basket",
        "order_info": {
            "client_id": "<client id>",
            "disclosedQuantity": 0,
            "exchange": "NSE",
            "execution_type": "REGULAR",
            "instrument_token": 14366,
            "order_side": "BUY",
            "order_type": "LIMIT",
            "price": 0,
            "product": "MIS",
            "quantity": 1,
            "series": "EQ",
            "trading_symbol": "IDEA-EQ",
            "trigger_price": 0,
            "underlying_token": "14366",
            "validity": "DAY",
            "user_order_id": 10002
        }
     }
)

Response

{
  "data": {
    "basket_id": "9cd5fbc3-333b-4934-8d45-e692349b5ede",
    "basket_type": "NORMAL",
    "is_executed": false,
    "login_id": "<client id>",
    "name": "Y_Basket",
    "order_type": "LIMIT",
    "orders": [
      {
        "order_id": "d5950a9f-b538-458b-a3cd-1dec744cb931",
        "order_info": {
          "login_id": null,
          "order_status": null,
          "rejection_code": 0,
          "exchange": "NSE",
          "sl_trigger_price": 0,
          "client_id": "<client id>",
          "mode": "NEW",
          "product": "MIS",
          "rejection_reason": "",
          "order_side": "BUY",
          "market_protection_percentage": 0,
          "nnf_id": 0,
          "validity": "DAY",
          "trading_symbol": "IDEA-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": 0,
          "segment": "",
          "underlying_token": "14366",
          "sl_order_price": 0,
          "instrument_token": 14366,
          "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": 10002,
          "source": null
        }
      }
    ],
    "product_type": "ALL",
    "sip_eligible": false,
    "sip_enabled": false
  },
  "message": "Order added in the basket Y_Basket.",
  "status": "success"
}
Field NameDescription
basket_idUnique identifier for the basket.
basket_typeType of the basket.
is_executedIndicates whether the basket has been executed.
login_idIdentifier for the user’s login.
nameName of the basket.
order_typeType of orders in the basket(eg. LIMIT).
order_idUnique identifier for the order.
exchangeExchange where the order is placed.
client_idIdentifier for the order’s login.
modeMode of the order.
productProduct type associated with the order.
order_sideSide of the order.
validityValidity of the order.
trading_symbolSymbol for the traded security.
execution_typeType of execution.
quantityQuantity of shares in the order.
pricePrice specified for the order.
segmentSegment of the market.
underlying_tokenToken for the traded security.
instrument_tokenToken for the traded security.
target_price_typeType of target price.
user_order_idIdentifier for the user’s order.
market_protection_percentageMarket protection percentage.
nnf_idNNF ID.
seriesTrading series.
lot_sizeLot size.
disclosed_quantityDisclosed quantity.
order_entry_timeTime of order entry.
sl_order_quantityQuantity of shares for stop loss order.
order_typeType of order.
average_priceAverage price of filled shares.
depositDeposit amount.
average_trade_priceAverage trade price.
filled_quantityQuantity of shares filled.
order_status_infoInformation about order status.
trailing_stop_lossTrailing stop loss value.
sl_trigger_priceTrigger price for stop loss order.
sl_order_pricePrice for stop loss order.
trade_priceTrade price.
symbolSymbol for the traded security.
order_tagOrder tag.
spread_tokenSpread token.
isinISIN of the traded security.
pro_cliType of client.
tagsAdditional tags for the order.
last_activity_referenceReference for the last activity.
square_off_valueValue for square off.
remaining_quantityRemaining quantity of shares.
square_offIndicates if the order is square off.
stop_loss_valueStop loss value for the order.
exchange_order_idExchange order ID.
exchange_timeTime of exchange order.
deviceDevice from which the order was placed.
sourceSource of the order.

Error Response

  {
     "data": {},
     "error_code": 46001,
     "message": "Instrumetn already added",
     "status": "error"
  }