Incorrect filled_quantity retuned with API Get_order_details for the order with ID 240816000520774

Hello,

I placed the intraday IOC Limit order on BSE. The order ID is 240816000520774.
After placing the order, I chekced the filled quantity using Get Order Details API. It shows 0.
But in reality, filled quantity was 61.

Can you check the discrepancy.

Thanks,
Saurabh
Client Id:01111129

Thank you for reaching out. This situation is unusual, and we’ll work on reproducing the issue and get back to you. In the meantime, if you could provide a screenshot or a short video demonstrating the problem, it would greatly assist us in debugging it more effectively.

Hello Pradeep,

I do not have any screenshot or video.
I can share with you, the python code which I am using:

data_place_order = {
	'quantity': 61,
	'product': 'I',
	'validity': 'IOC',
	'price': 677.15,
	'tag': 'string',
	'instrument_token': data[key_bse]['instrument_token'],
	'order_type': 'LIMIT',
	'transaction_type': 'SELL',
	'disclosed_quantity': 0,
	'trigger_price': 0,
	'is_amo': False,
}
response_place_order = requests.post(url_place_order, json=data_place_order, headers=headers_place_order)
if response_place_order.status_code != 200:
	print("Err_BSE_SELL", response_place_order.status_code, str(value_scrip), data_place_order)
	return

response_get_order_details = None
_order_id = None
response_dict_place_order = json.loads(response_place_order.text)
_order_id = response_dict_place_order['data']['order_id']
params_get_order_details = {'order_id': _order_id}
response_get_order_details = requests.get(url_get_order_details, headers=headers_get_order_details, params=params_get_order_details)
if response_get_order_details.status_code != 200:
	print(retry_cnt, "Err_BSE_ORDER_DETAILS Returning")
	return
response_dict_get_order_details_bse = json.loads(response_get_order_details.text)
if response_dict_get_order_details_bse['data']['filled_quantity'] <= 0:
	print("BSE Filled Quantity 0")
	return

I am getting this statement printed: “BSE Filled Quantity 0”. But order 240816000520774 has filled quantity as 61.
This is very important. API behavior has to be reliable and consistent.
Also, please let me know, if I am doing anything wrong.

Thanks,
Saurabh

Thank you for the information. We will review it and get back to you as soon as possible.

Hello @saurabhkumarbansal,

Upon reviewing your code, it appears that you have placed a limit sell order and stored the order ID in the _order_id variable. Following this, you are making a call to the Get Order Details API.

The most likely reason for seeing filled_quantity as 0 is that your limit order has not yet been executed. According to the documentation, filled_quantity represents “the total quantity traded for this particular order.” Once your order is executed on the exchange, the quantity will be reflected in this field.

Thank you.

1 Like

Hello @Ketan @Pradeep_Jaiswar

It was not ‘DAY’ order, it was ‘IOC’.

I placed an IOC (Immediate or Cancel) LIMIT order for a particular price 677.15.
IOC Limit orders are immediately filled for the best price or cancelled immediately.
Whatever happens, it has to be immediate.
In this buggy case, Order gets executed with filled quantity as 61 but get_order_api returned 0 as filled_quantity.

It happens quite often. This bug is not rare.

Thanks,
Saurabh

Hello @Ketan @Pradeep_Jaiswar

How about this issue ?
is it being fixed ?

The filled_quantity indicates “the total quantity traded for this specific order.” If the order has been successfully executed, this value will be greater than zero. In the case of canceled or open orders, it will remain zero.

Here is an example of completed BSE IOC limit order

Thank you.