Issue with Kite Publisher

dhana916
dhana916 edited April 2018 in Kite Publisher
Hi,
I have been using below code to place orders, been tested and working fine a week back or so.
$(".table > tbody  > tr:not(:first-child)").each(function () {
var Id = parseInt($(this).closest('tr').find('#item_Id').val());
var symbol = $(this).closest('tr').find('#item_Symbol').val();
var ordertype = $(this).closest('tr').find('.ordertypevalue').val();
var buyselloption = $(this).closest('tr').find('.buysellvalue').val();
var validity = $(this).closest('tr').find('.validityvalue').val();
var purchasetype = $(this).closest('tr').find('.purchasetypevalue').val();
var cicuitlimit = parseFloat($(this).closest('tr').find('.circuitlimitvalue').val()).toFixed(2);
var IsExcluded = $(this).closest('tr').find('.isexcluded').prop('checked');
var updownvalue = $(this).closest('tr').find('.updownvalue').val();
var quantity = parseInt($(this).closest('tr').find('.quantityvalue').val());
var currentprice = $(this).closest('tr').find('.currentprice').val();
var tenderprice = $(this).closest('tr').find('.tenderprice').val();
var OrderItemModel = { Id: Id, Validity: validity, Quantity: quantity, PType: purchasetype, Exclude: IsExcluded, CircuitLimit: cicuitlimit, OrderType: ordertype, BuySellType: buyselloption, UpDown: updownvalue, TargetPrice: tenderprice, CMP: currentprice, Symbol: symbol };
orders.push(OrderItemModel);
});
// 3. loop through each item & add to kite publisher
// Initialize a new Kite instance.
// You can initialize multiple instances if you need.
var kite = new KiteConnect("api-key");

orders.forEach(function (item) {
var price = item.TargetPrice - item.TargetPrice % 0.05 + ((item.TargetPrice % 0.05 < 0.05 / 2) ? 0.0 : 0.05);
if (!item.Exclude != false && item.Quantity != 0) {
kite.add({
"exchange": "NSE",
"tradingsymbol": item.Symbol,
"quantity": item.Quantity,
"price": parseFloat(price).toFixed(2),
"transaction_type": item.BuySellType,
"order_type": item.OrderType,
"product": item.PType,
"validity": item.Validity
});
}
});
kite.connect();
I am getting below error message

{"status":"error","message":"Invalid orders payload.","data":null,"error_type":"InputException"}
This discussion has been closed.