From cf78f9ef1144e1defab8411c939a2eca58a490c6 Mon Sep 17 00:00:00 2001 From: Pratik Bhadane Date: Wed, 2 Aug 2023 12:06:12 +0530 Subject: [PATCH] Update orderResponse of placeOrder for smartConnect.py Enhanced user understanding: By incorporating the orderResponse return, users can now effectively discern whether their order placement was successful or not. The previous approach of only returning the orderId, which resulted in 'None' for failed placements, has been mitigated with this improvement. The resulting user experience is now significantly more informative and user-friendly. --- SmartApi/smartConnect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartApi/smartConnect.py b/SmartApi/smartConnect.py index 2bfbbe0f..bf8f8994 100644 --- a/SmartApi/smartConnect.py +++ b/SmartApi/smartConnect.py @@ -282,7 +282,7 @@ def placeOrder(self,orderparams): if params[k] is None : del(params[k]) - orderResponse= self._postRequest("api.order.place", params)['data']['orderid'] + orderResponse= self._postRequest("api.order.place", params) return orderResponse