py5paisa
py5paisa copied to clipboard
Unable to place new orders using place_orders()
- 5paisa Python SDK version: 0.5.5
- Python version: 3.8.2
- Operating System: macOS Big Sur v11.4
Description
- We are unable to place new orders using client.place_orders() as mentioned in this repo README.md
- There is no documentation on place Intraday Limit orders using this same function. How can we do that?
What I Did
client.place_order(OrderType='S',Exchange='N',ExchangeType='D', ScripCode = 47925, Qty=50, Price=50)
This is the output I get:
14:33:43 | 'body'
None
I modified the source code of the SDK to get a bit more detailed error:
{'Message': 'Error while processing, Please try to re-login'}
Traceback (most recent call last):
File "poc.py", line 329, in <module>
main()
File "poc.py", line 312, in main
place_test_order(client)
File "poc.py", line 272, in place_test_order
response = client.place_order(OrderType='S',
File "/Users/saigal/envs/trading/lib/python3.8/site-packages/py5paisa/py5paisa.py", line 377, in place_order
return self.order_request("OP")
File "/Users/saigal/envs/trading/lib/python3.8/site-packages/py5paisa/py5paisa.py", line 248, in order_request
log_response(res["body"]["Message"])
KeyError: 'body'
Can we please check this ?