while Exiting the position Generally STATUS code : 200 is coming but today due to different code : 201 the logic didn’t trigger. as condition was
if sell_response.get(‘code’) == 200:
sell_exit_success = True
why code : 201 comes any specific reason does anyone faced this issue before ?
Hey @jP5c4yzPA2
Can you please let us know the inputs given
Hi Abhishek
so basically once certain Amt is achieved we execute sell order below is the code snippet
sell_data = { “id”: id_sell }
try:
sell_response = fyers.exit_positions(data=sell_data) print(sell_response)
if sell_response.get(‘code’) == 200:
sell_exit_success = True
Through API response should be 200 , but today got 201
{‘code’: 201, ‘message’: ‘Exit request has been sent. Kindly refresh your positions to check the status.’, ‘s’: ‘ok’}
Hey @jP5c4yzPA2
201 comes when the counter order has been placed but not filled due to low liquidity or other reason as well , the same in stated in the docs
https://myapi.fyers.in/docsv3#tag/Other-Transactions/paths/~1OtherTrans/delete