Yes, I have tried. You can check the order_ids in your system, the main issue is resolved from the POV of operations. But two other issues have cropped up, as highlighted in points 1 and 6. It seems as if the API is fetching responses from some cache and not updating in REAL TIME. You kindly check on your side what it is:
D:\strategyu>python ordertest.py
1) Placed BUY Order and set out to check order_status with get_order_details using the returned order_id (because I can not place a SL order unless my order is complete), I get this response:
Exception in get_order_details for order_id 230912025593635: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Tue, 12 Sep 2023 06:01:21 GMT’, ‘Content-Type’: ‘application/json’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘keep-alive’, ‘Vary’: ‘Origin, Access-Control-Request-Method, Access-Control-Request-Headers’, ‘message’: ‘request failed’, ‘requestId’: ‘9c8de954-f734-488c-9ace-be13ede43496’, ‘X-Content-Type-Options’: ‘nosniff’, ‘X-XSS-Protection’: ‘1; mode=block’, ‘Cache-Control’: ‘no-cache, no-store, max-age=0, must-revalidate’, ‘Pragma’: ‘no-cache’, ‘Expires’: ‘0’, ‘Strict-Transport-Security’: ‘max-age=0; includeSubDomains’, ‘X-Frame-Options’: ‘DENY’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘Set-Cookie’: ‘_cfuvid=fj2USb9cC0V1xULzWLoV8uG_bFdpoamb4.e6hQKQEs4-1694498481812-0-604800000; path=/; domain=.upstox.com; HttpOnly; Secure; SameSite=None’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘8055ef75ca3c3c04-BOM’})
HTTP response body: b’{“status”:“error”,“errors”:[{“errorCode”:“UDAPI100010”,“message”:“Order not found”,“propertyPath”:null,“invalidValue”:null,“error_code”:“UDAPI100010”,“property_path”:null,“invalid_value”:null}]}’
2) Regardless of exception above, we keep checking. Once order_status is complete, I get this response:
BUY Order complete @151.55
3) Then I place SL order for the same:
SL order 230912025593670 placed. Trigger: 115.00, Price: 100.00
[15, 115.0]
4) Then I try modifying the SL order with success (it’s now updating price and trigger_price in dashboard):
modify to: {‘order_id’: ‘230912025593670’, ‘price’: 112.0, ‘trigger_price’: 117.0, ‘validity’: ‘DAY’, ‘order_type’: ‘SL’}
{‘data’: {‘order_id’: ‘230912025593670’}, ‘status’: ‘success’}
SL Order modified
5) Then I again try modifying the SL order with success (it’s now updating price and trigger_price in dashboard):
modify to: {‘order_id’: ‘230912025593670’, ‘price’: 121.0, ‘trigger_price’: 140.0, ‘validity’: ‘DAY’, ‘order_type’: ‘SL’}
{‘data’: {‘order_id’: ‘230912025593670’}, ‘status’: ‘success’}
SL Order modified
6) Then I return the last object from get_order_details on the SL order but it doesn’t reflect the latest updated price and trigger_price, but the one before:
[{‘average_price’: 0.0,
‘disclosed_quantity’: 0,
‘exchange’: ‘NFO’,
‘exchange_order_id’: ‘1500000045934381’,
‘exchange_timestamp’: ‘2023-09-12 11:31:24’,
‘filled_quantity’: 0,
‘instrument_token’: ‘NSE_FO|44534’,
‘is_amo’: False,
‘order_id’: ‘230912025593670’,
‘order_request_id’: ‘2’,
‘order_timestamp’: ‘2023-09-12 11:31:24’,
‘order_type’: ‘SL’,
‘parent_order_id’: ‘NA’,
‘placed_by’: None,
‘price’: 112.0,
‘product’: ‘I’,
‘quantity’: 15,
‘status’: ‘trigger pending’,
‘status_message’: None,
‘tag’: ‘long’,
‘tradingsymbol’: ‘BANKNIFTY13SEP2345600CE’,
‘transaction_type’: ‘SELL’,
‘trigger_price’: 117.0,
‘validity’: ‘DAY’,
‘variety’: None}]