Error when trying to Modify Order from LIMIT to MARKET

Sushil_NSE
Below is snippet from my Original Code -

$company_code = $row["tradingsymbol"];
$order_id = $row["order_id"];
$quantity = $row["quantity"];

// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "https://api.kite.trade/orders/regular/$order_id");
//curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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"
));
$data="order_type=MARKET&quantity=$quantity&validity=DAY";

echo $data;
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// grab URL and pass it to the browser
$response=curl_exec($ch);

// close cURL resource, and free up system resources
print_r($response);


When i run my Above Code i get error that data part is null in my request.

Kindly Help.

Regards,
Sushil


This discussion has been closed.