not receiving Postback

Kamalv
@sujith @rakeshr i opted for postback but not receiving any data (not hitting the method). can you help me to solve this?

postback url:
https://abc.com/test-postback

in my code:
@app.route('/test-postback', methods=['GET'])
def get_zerodha_postback2():
print('called method')
try:
postback_raw = request.json
print('Postback', postback_raw)
return '200'
except Exception as e:
print(e)
return "1000"
Tagged:
  • rakeshr
    You won't receive postback update for every order status. Go through postback FAQs here.
  • Kamalv
    @rakeshr Thanks for the response.

    1. I placed order through API.
    2. url looks fine for me.
    3. Based on my understanding modified the code a little, will this work or am i missing anything?

    @app.route('/test-postback', methods=['POST'])
    def get_zerodha_postback():
    print('called method')
    try:
    postback_raw = request.get_data()
    print('Postback', postback_raw)
    return '200'
    except Exception as e:
    print(e)
    return "1000"
  • rakeshr
    will this work or am i missing anything?
    Yes, your flask route, methods argument and data parsing using get_data looks fine well.
Sign In or Register to comment.