Error while posting Order "Missing or empty field `exchange

gautam_s60
gautam_s60 edited January 2018 in General
Hi,
I am getting error " exchange" missing while posting order even though i am sending exchange as NSE.
i know this order must be rejected...
error :{"status":"error","message":"Missing or empty field `exchange`","data":null,"error_type":"InputException"}
please help


my code foxpro

CLOSE TABLES
USE tkns
ZAP
Append From "c:/xampp/htdocs/dashboard/tkns.txt" Type Sdf
GOTO 1
mapi=ALLTRIM(api) &&api_key
ms=ALLTRIM(s) && secrete
mr=ALLTRIM(r) &&request token
ma=ALLTRIM(a) && access token
mp=ALLTRIM(p) &&public token
ODR_HTTP =Createobject( "Msxml2.XMLHTTP.6.0" )
ord_var="api_key="+mapi+"&access_token="+ma+"&tradingsymbol=ACC&exchange=NSE&transaction_type=BUY&order_type=LIMIT&quantity=1&price=2400&product=CNC"
mURL_order = "https://api.kite.trade/orders/regular/"
ODR_HTTP.Open("POST",mURL_order,.T.) && .t. stands true
ODR_HTTP.setRequestHeader("Content-Type","application/json")
ODR_HTTP.setRequestHeader("x-kite-version",3)
ODR_HTTP.setRequestHeader("Authorization","token "+mapi+":"+ma)
ODR_HTTP.Send(ord_var)
?ord_var
WAIT TIMEOUT 3
?ODR_HTTP.RESPONSETEXT
Tagged:
This discussion has been closed.