99.99% of API orders are in derivative segment, but all examples are in Equity (Segment) why?

Namaskara,

In my opinion 99.9% of the orders using the API is in the derivative segment (futures and options, … chiefly options).

However all the documentation examples are entirely of Equity segment.

For Eg: Place Order

{
“quantity”: 1,
“product”: “D”,
“validity”: “DAY”,
“price”: 0,
“tag”: “string”,
“instrument_token”: “NSE_EQ|INE848E01016”,
“order_type”: “MARKET”,
“transaction_type”: “BUY”,
“disclosed_quantity”: 0,
“trigger_price”: 0,
“is_amo”: false
}

while its illustrative, but not comprehensive.

Please give thought : Make the documented examples that are more relevant to the majority of usage… Please give comprehensive set of examples in

  1. Index Options
  2. Stock Options
  3. Index Futures
  4. Stock Futures
  5. Commodity options
  6. Commodity Futures

That way it will be easy for any developer to test this syntax and semantics easily.

Regards
Rathnadhar K V

Hi @RathnadharKV
We understand that most API orders are for derivative segments. However, derivative instrument keys expire regularly, and using expired instruments in examples would be unhelpful to users.

Additionally, we prefer to use equity stocks priced under ₹100 for examples. This minimizes financial risk if a user inadvertently copies and places an order. Furthermore, a sell order for an equity stock requires EDIS if present in your holdings. If a user unknowingly copies a sell order example with a derivative instrument, it could lead to a short sell of an option, which requires significant margin and poses a substantial financial risk for someone merely trying out the API. Our intention behind using inexpensive equity instruments in examples was to mitigate these risks.

I hope this helps.

Thanks!

Namaskara,

Thanks for the lighthning speed reply!

Example are as name states are examples.

They are not live code/templates. They are there for coding reference that is all. Nobody gets influenced by examples to hard code the values in live. If they are so dumbos then they dont deserve to be a developer. These API are certainly not meant for them.

Further if you give example of an expired contract. That is more fool proof than any equity under 100 Rs. scenario, since the exchange itself will reject the order therefore, there is no financial liability.

My question still stands and my request is

Please give examples of Derivative segments in NSE and MCX.

Regards
Rathnadhar K V

1 Like

Namaskara,

While I have to live with the quixotic reason provided for only illustrating a equity order in examples…

Even for reference, there is no glossary of the entire list of fields that are needed for derivative (F&O) orders. I am struck with derivative (F&O) order placement and modification, as there is no document as to which fields have to be provided for a valid order mandate.

At least, here, for my reference, kindly provide an example of Derivative order placement and modification. I will give an undertaking that I will not copy paste the value from here (I believe I am not that dumbo to do it)… to my code and further indemnify UPSTOX against loss incurred by me with such a dumbo action of mine on me.

So now please give the list of fields..

Regards
Rathnadhar K V

Namaskara:

On Upstox website, in the chat I got this information… for placing the Derivative order:

Example API Request

Here’s a hypothetical JSON structure for placing an order:

{
  "instrument": "NIFTY",
  "strike_price": 23150,
  "expiry": "2025-02-06",
  "order_type": "CALL",
  "quantity": 1,
  "price": 100
}

In this example:

  • Instrument: NIFTY
  • Strike Price: 23150
  • Expiry: 2025-02-06
  • Order Type: CALL (indicating a call option)
  • Quantity: 1 (number of contracts)
  • Price: 100 (premium for the option)

For more detailed information, you can refer to the Upstox API documentation.

Kindly validate if the above information is comprehensive and accurate.

Regards
Rathnadhar K V

Namaskara,

On requesting the placing of Nifty50 Futures order I got this reply:

  1. Place the Future Order:
  • Use the appropriate endpoint to place a future order. Here’s an example of the JSON structure for placing a future order:
{
  "instrument": "NIFTY",
  "quantity": 1,
  "order_type": "LIMIT",
  "price": 23150,
  "product_type": "FUTURE"
}

In this example:

  • Instrument: NIFTY (the underlying asset)
  • Quantity: 1 (number of contracts)
  • Order Type: LIMIT (indicating a limit order)
  • Price: 23150 (the price at which you want to place the order)
  • Product Type: FUTURE (indicating that this is a futures order)
  1. Check Order Status:
  • After placing the order, you can check its status using the relevant API endpoint.

Kindly validate the fields, if they are comprehensive and accurate

Namaskara,

Can somebody in Upstox validate this for me please.

Regards
Rathnadhar K V