It looks like you're new here. If you want to get involved, click one of these buttons!
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;
It seems like readme is not updated. We will update it soon.
The first param for placing an order is variety and then params.
Check out code here.
You should be passing param variety as first param and then other option inarray like below