Hi All, Need help with below. Once my Overall target is achieved i am trying to release my Open Orders to Market price but not able to do so as getting below error - {"status":"error","message":"Request method not allowed","data":null,"error_type":"GeneralException"}
/***************************** Modify Zerodha Order : Start ******************************/ // create a new cURL resource $ch = curl_init();
// set URL and other appropriate options // Use below for Market Orders curl_setopt($ch, CURLOPT_URL, "https://api.kite.trade/orders/regular/$current_order_id"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'X-Kite-Version: 3', "Authorization: token $API_KEY:$ACCESS_TOKEN" )); // grab URL and pass it to the browser // Modify to MARKET Orders $data="quantity=$quantity&order_type=MARKET&validity=DAY"; echo $data; curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response=curl_exec($ch);
// close cURL resource, and free up system resources print_r($response); /***************************** Modify Zerodha Order : End ******************************/
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");