Error in node client

cmurthy
Hi there,

I am using node and when I try to place order on kite API I get the following error on orderPlace.

TypeError: Cannot assign to read only property 'variety' of {"tradingsymbol":"CESC","exchange":"NSE","transaction_type":"Buy","quantity":1,"product"
:"MIS","price":800}

could you please guide me on whats the issue here?

Regards,
Murthy
Tagged:
  • cmurthy
    specifically I am getting error on self.orderPlace at below line

    params.variety = variety === undefined ? "regular" : variety;
  • sujith
    Hi @cmurthy,
    Check out placeOrder() method in this Example.
    You need to pass transaction_type in upper case (BUY), send variety in params. Check if other params that you are sending correct or not.
  • cmurthy
    Hi Sujith,
    I still get the same error, below is the JSON I am passing.
    {"variety":"regular","tradingsymbol":"CESC","exchange":"NSE","transaction_type":"BUY","q
    uantity":1,"product":"MIS","price":800}

  • cmurthy
    I am able to do other functions, for example I am able to fetch margins
  • sujith
    sujith edited March 2017
    Can print and paste the whole error response here?
  • cmurthy
    I think I solved it.
    I was doing a JSON.stringify() on params, but I forgot to remove this statement.
    Once I removed this it is working fine.
This discussion has been closed.