Multiple apps with same redirect and postback url

mylandilip
Hi,

I currently have 2 apps setup(one for me and other my wife kite account) in my developer account and they use two separate api keys and secret.

I have setup a python client to get the access token based on the user/app and access_token is fetched as a proper response for each user(using api key/secret) and stored into a file(with user name tag).

However, when trying to place order the kite place_order api is not able to execute/place the trade with the provided api_key + access_token and responds with a exception message which has only user name in it.

Trying to place orders for both users and it responds with same error most times. After sometime(post multiple tries), all the orders gets placed as expected.

Not able to understand if there is any delay or ordering or any mechanism that needs to be followed to ensure place order is successful post successful access token fetch from the same python client for 2 apps.

please advise.
  • nagavenij
    Please provide the full exception/error details, including the API endpoints used and the parameters passed, to help us determine the exact issue.
  • mylandilip
    user 1 with unique api_key/secret and successful order placement with no errors

    DEBUG:asyncio:Using selector: GeventSelector
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 200 None
    Received place order request: {'orderType': 'Simple', 'priceType': 'Limit', 'transactionType': 'BUY', 'scrip': 'INFY', 'quantity': 1, 'price': 1460, 'triggerPrice': '0', 'users': ['Dilip']}
    Found 1 pending orders.
    Processing order dilip_infy_buy_1460_211125095422835
    {'orderType': 'Simple', 'priceType': 'Limit', 'transactionType': 'BUY', 'scrip': 'INFY', 'quantity': 1, 'price': 1460, 'triggerPrice': '0', 'user': 'dilip', 'status': 'OPEN', 'transactionDate': '2025-11-21', 'id': 'dilip_infy_buy_1460_211125095422835', 'entry_orderId': '', 'orderId': ''}
    place order request received
    {'orderType': 'Simple', 'priceType': 'Limit', 'transactionType': 'BUY', 'scrip': 'INFY', 'quantity': 1, 'price': 1460, 'triggerPrice': '0', 'user': 'dilip', 'status': 'OPEN', 'transactionDate': '2025-11-21', 'id': 'dilip_infy_buy_1460_211125095422835', 'entry_orderId': '', 'orderId': ''}
    New Order created with order_id - 25112119
    {'status': 'SUCCESS', 'order_id': '25112119', 'quantity': 1}
    All orders processed and saved.


    user 2 with same redirect url and different api_key/secret but failing with error as username

    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): kite.zerodha.com:443
    DEBUG:urllib3.connectionpool:https://kite.zerodha.com:443 "GET /connect/login?api_key=apikey&v=3 HTTP/1.1" 302 0
    DEBUG:urllib3.connectionpool:https://kite.zerodha.com:443 "GET /connect/login?api_key=apikey&sess_id=DnSGPsJ4vYdHLRze9Ipnku5MWcEn7p HTTP/
    1.1" 200 None
    DEBUG:urllib3.connectionpool:https://kite.zerodha.com:443 "POST /api/login HTTP/1.1" 200 None
    DEBUG:urllib3.connectionpool:https://kite.zerodha.com:443 "POST /api/twofa HTTP/1.1" 200 42
    DEBUG:urllib3.connectionpool:https://kite.zerodha.com:443 "GET /connect/login?api_key=apikey&v=3 HTTP/1.1" 302 0
    DEBUG:urllib3.connectionpool:https://kite.zerodha.com:443 "GET /connect/finish?api_key=apikey&sess_id=sxomvTkFl9Jy2aC5BgJAn1SFPHXUXa HTTP
    /1.1" 302 0
    127.0.0.1 - - [21/Nov/2025:10:04:33 +0530] "GET /?status=success&request_token=token&action=login&type=login HTTP/1.1" 200
    3865 "-" "python-requests/2.32.5"
    DEBUG:urllib3.connectionpool:https://domain:443 "GET /?status=success&request_token=token
    mpFLh88I&action=login&type=login HTTP/1.1" 200 3865
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 200 None
    DEBUG:asyncio:Using selector: GeventSelector
    {'api_key': 'api_key', 'access_token': 'access_token', 'generated_date': '21-11-2025'}
    Found 1 pending orders.
    Processing order shan_infy_buy_1460_211125100433499
    {'orderType': 'Simple', 'priceType': 'Limit', 'transactionType': 'BUY', 'scrip': 'INFY', 'quantity': 1, 'price': 1460, 'triggerPrice': '0', 'user': '
    shan', 'status': 'OPEN', 'transactionDate': '2025-11-21', 'id': 'shan_infy_buy_1460_211125100433499', 'entry_orderId': '', 'orderId': ''}

    Exception: failed: 'shan'

    kite.placeorder is the endpoint.

    please let me know if you need further details.

  • Nivas
    I could not find any error specifically related to Kite Connect. It appears the issue is originating within your codebase.

    Kite Connect is purely an execution platform. While we are always happy to provide support and troubleshooting for any direct issues or errors within the Kite Connect API itself, we are unable to offer support or debugging assistance for custom client-side coding or logic.
Sign In or Register to comment.