pocketful logo light
pocketful logo light

Edit Basket Instrument

The method editBasketInstrument is used to edit the basket instrument present in the basket. In this we are able to edit the basket instrument details like quantity.

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

Request Packet

{
    "basket_id":"72fa28f8-7c08-4a4d-ba7a-fedd461744a1",
    "name":"h",
    "order_info":
    {
      "exchange":"NSE",
      "instrument_token":3045,
      "client_id":"DEMO1",
      "order_type":"LIMIT",
      "price":506.5,
      "quantity":1,
      "disclosed_quantity":0,
      "validity":"DAY",
      "product":"MIS",
      "trading_symbol":"SBIN-EQ",
      "order_side":"BUY",
      "user_order_id":10002,
      "underlying_token":"3045",
      "series":"EQ",
      "oms_order_id":"a5d13c1f-f99c-4230-ad19-9ed8e826ee74",
      "exchange_order_id":"",
      "trigger_price":0,
      "stop_loss_value":0,
      "square_off_value":0,
      "trailing_stop_loss":0,
      "is_trailing":false,
      "execution_type":"BO"
    },
  "order_id":"a5d13c1f-f99c-4230-ad19-9ed8e826ee74"
}

Parameters

FieldNameDatatypeDescription
basket_idStringRepresents the unique id of basket.
nameStringRepresents the name of the basket.
exchangeStringNSEBSENFOMCX
instrument_tokenStringRepresents unique id of a particular instrument.
client_idStringRepresents the unique id of user or username.
order_typeStringLIMITSL
priceStringIt can’t be zero.
quantityNumberIt can’t be zero.
disclose_quantityNumberIt can’t be a negative number.
validityStringDay or IOC
productStringCNCMISNRML
trading_symbolStringRepresents the name of the instrument.
order_sideStringBUY or SELL
user_order_idNumberUnique id
underlying_tokenNumberIt is the token of the base equity instrument.
seriesStringRepresents the particular series based on exchange.
oms_order_idStringRepresents the unique id given by OMS.
exchange_order_idStringRepresents the unique id given by the exchange.
trigger_priceNumberIt can’t be zero.
stop_loss_valueNumberIt can’t be zero.
square_off_valueNumberIt can’t be zero.
trailing_stop_lossNumberIt can’t be zero.
is_trailingBooleanTrue or False
execution_typeStringREGULARBOCOAMO
order_idStringRepresents the unique id of the order.

Example

data = pocket.editBasketInstrument({

    "basket_id":"72fa28f8-7c08-4a4d-ba7a-fedd461744a1",
    "name":"h",
    "order_info":
    {
      "exchange":"NSE",
      "instrument_token":3045,
      "client_id":"DEMO1",
      "order_type":"LIMIT",
      "price":506.5,
      "quantity":1,
      "disclosed_quantity":0,
      "validity":"DAY",
      "product":"MIS",
      "trading_symbol":"SBIN-EQ",
      "order_side":"BUY",
      "user_order_id":10002,
      "underlying_token":"3045",
      "series":"EQ",
      "oms_order_id":"a5d13c1f-f99c-4230-ad19-9ed8e826ee74",
      "exchange_order_id":"",
      "trigger_price":0,
      "stop_loss_value":0,
      "square_off_value":0,
      "trailing_stop_loss":0,
      "is_trailing":false,
      "execution_type":"BO"
    },
  "order_id":"a5d13c1f-f99c-4230-ad19-9ed8e826ee74"
})

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.
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.
rejection_codeCode indicating reason for rejection.
rejection_reasonReason for rejection of the order.
market_protection_percentageMarket protection percentage.
validityValidity of the order.
trading_symbolSymbol for the traded security.
trigger_priceTrigger price for the order.
is_trailingIndicates if trailing stop loss is enabled.
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 the 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.
pricePrice specified for the order.
segmentSegment of the market.
underlying_tokenToken for the traded security.
sl_order_pricePrice for stop loss order.
instrument_tokenToken for the traded security.
trade_priceTrade price.
symbolSymbol for the traded security.
target_price_typeType of target price.
execution_typeType of execution.
quantityQuantity of shares in the order.
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.
user_order_idUser order ID.
sourceSource of the order.
product_typeType of product.
sip_eligibleIndicates if SIP (Systematic Investment Plan) is eligible for the basket.
sip_enabledIndicates if SIP (Systematic Investment Plan) is enabled for the basket.
messageInformation message related to the operation performed on the basket.
statusStatus of the operation performed on the basket.

Error Response

 {
  "data": {},
  "error_code": 48004,
  "message": "`order_info` order price cannot be zero in SL/LIMIT order",
  "status": "error"
}