I am getting HTTP 400/403 for bracket orders

g0g0l
I am POSTing data to https://api.kite.trade/orders/bo and I am getting 400 when encoding with UTF-16 and 403 when encoding UTF-8. Parameters are as follows

trailing_stoploss=1
stoploss_value=20.55
api_key=xxxxxxxxxxxxx
quantity=226
price=2490.45
transaction_type=BUY
tradingsymbol=TCS
access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
exchange=NSE
validity=DAY
order_type=LIMIT
squareoff_value=14.50
product=MIS

What am I missing?
  • sujith
    Hi @g0g0l,
    What client are you using?
    Can you print error message and check?
  • g0g0l
    I am using httpsUrlConnection in android. I get the error message
    {"status": "error", "message": "Missing api_key", "error_type": "InputException"}
    But I am actually providing api_key as mentioned previously
  • sujith
    Hi @g0g0l,
    You need to pass api_key while making request.
  • g0g0l
    Ok I passed api_key along with url while making request. Now I am getting error
    {"status": "error", "message": "That API call is not allowed for the authenticated user", "error_type": "PermissionException"}
    And this is happening for all kinds of orders. Why is that?
  • sujith
    Hi @g0g01,
    You can only use, the user id with which you have created Kite Connect app.
  • g0g0l
    You mean the client id? I am using the same client id which is RB2176. Can you please check if there is any permission issue?
  • g0g0l
    Also my app is to be for all users who, upon creating a Zerodha account, can trade using my app. Can you please also enable this api for general use?
  • sujith
    @g0g0l,
    Please write to talk(at)rainmatter.com.
  • g0g0l
    Ok just sent an email. Please take care of this ASAP, otherwise I will lose users
  • g0g0l
    Hello, is there any progress about my request? My app was previously allowed for use by any user. I wonder when did it stop?
  • sujith
    sujith edited March 2017
    Hey. I believe you used Kite Publisher for order placement. You only have read access to Kite Connect, wherein you can fetch the users' portfolio and orders. This has always been the case. Perhaps you've made a change with respect to order placement on your end?
  • g0g0l
    g0g0l edited March 2017
    Yes that is true, I have been using Kite publisher for order placement in order to avoid exchange approval requirements. But since my kite app is connect+publisher and 2000 credits are being deducted every month, my app should have the permission to allow all modes of order placement, at least for my client id, right? In fact, when I first used the api, I tested with all modes of order and everything worked perfectly
  • g0g0l
    Hello, can anyone respond please?
  • sujith
    sujith edited March 2017
    Hi @g0g01,
    We don't support permission for user or groups.
    we support permissions to the app. Users cannot use Kite Connect app as a multipurpose app. It can be either platform or a personal app.
  • g0g0l
    g0g0l edited March 2017
    It is a platform app. Can it be given permission to allow kite connect type trades? Please tell me what I need to do to enable all modes of order placement.
  • g0g0l
    Ok I just had a discussion with Mr. Shiva over the phone. I understand the rules now. You can close this thread
This discussion has been closed.