Hello, I have python code written such that it places orders through two accounts. For orderupdates I am using a valid postback url which I have configured on API page (https://developers.kite.trade/apps/). Issue is I am getting postback json data on one ID but not the other. I have double checked setup on API page and it is correct. BTW, both orders gets placed back to back and in my python I am handling postback request in async (so thats correct as well)
@app.route('/orderupdate', methods=['POST']) async def OrderUpdate(): # Extract the postback data from the request payload postback_data = request.get_data() #print(postback_data)
# Process the postback data asynchronously await process_postback_data(postback_data)
async def process_postback_data(postback_data): # Parse the postback data as JSON postback_json = json.loads(postback_data) print(postback_json) .--- rest of logic come here...
if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.gather(app.run(),process_postback_data(request.get_data()) ))
@app.route('/orderupdate', methods=['POST'])
async def OrderUpdate():
# Extract the postback data from the request payload
postback_data = request.get_data()
#print(postback_data)
# Process the postback data asynchronously
await process_postback_data(postback_data)
async def process_postback_data(postback_data):
# Parse the postback data as JSON
postback_json = json.loads(postback_data)
print(postback_json)
.--- rest of logic come here...
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(app.run(),process_postback_data(request.get_data()) ))