KITE 3 Order Fail

sushanthrd
sushanthrd edited January 2018 in PHP client
I am Using Code And Getting Error in pic
require_once('include/kiteconnect.php');
require_once('include/function.php');

$kite = new KiteConnect("XXX");

// Assuming you have obtained the `request_token`
// after the auth flow redirect by redirecting the
// user to $kite->login_url()
try {
$user = $kite->generateSession("XXX", "XXX");

echo "Authentication successful. \n";
print_r($user);
echo "</br>";
$kite->setAccessToken($user->access_token);
} catch(Exception $e) {
echo "Authentication failed: ".$e->getMessage();
throw $e;
}

echo $user->user_id." has logged in";
echo "</br>";
// Get the list of positions.



// Place order.
$order_id = $kite->placeOrder([
"tradingsymbol" => "INFY",
"exchange" => "NSE",
"quantity" => 1,
"transaction_type" => "BUY",
"order_type" => "MARKET",
"product" => "NRML"
], "regular")["order_id"];

echo "Order id is ".$order_id;

Sign In or Register to comment.