order history gives this. order placed at datetime.datetime(2026, 4, 9, 12, 11, 11). CANCELLED timestamp datetime.datetime(2026, 4, 9, 12, 12, 20) How to handle such exceptions ? wait in a loop until I get the status as 'CANCELLED' ?
When an order is cancelled, the status_message field will be empty/null since the cancellation was initiated at your end. The status_message field carries a reason only when an order gets rejected/failed.
To determine how much of the order was executed before cancellation, we suggest comparing the quantity (total quantity placed) and filled_quantity (quantity that got filled) fields from the Retrieving Orders API response. If filled_quantity is 0, it means no part of the order was executed before the cancellation.
Regarding polling — After you/your code initiates a cancellation request, you can poll the order status using this endpoint until the status transitions to a CANCELLED state.
CANCELLED timestamp datetime.datetime(2026, 4, 9, 12, 12, 20)
How to handle such exceptions ? wait in a loop until I get the status as 'CANCELLED' ?
[{'account_id': 'XXXX', 'placed_by': 'XXXX', 'terminal_id': '1111111111111088', 'order_id': '2042130686722629633', 'exchange_order_id': None, 'parent_order_id': None, 'status': 'OPEN PENDING', 'status_message': None, 'status_message_raw': None, 'order_timestamp': datetime.datetime(2026, 4, 9, 12, 11, 11), 'exchange_update_timestamp': None, 'exchange_timestamp': None, 'variety': 'regular', 'modified': False, 'exchange': 'BFO', 'tradingsymbol': 'SENSEX2640977100CE', 'instrument_token': 221837573, 'order_type': 'LIMIT', 'transaction_type': 'SELL', 'validity': 'DAY', 'validity_ttl': 0, 'product': 'NRML', 'quantity': 20, 'disclosed_quantity': 0, 'price': 204.1, 'trigger_price': 0, 'average_price': 0, 'filled_quantity': 0, 'pending_quantity': 20, 'cancelled_quantity': 0, 'market_protection': 0, 'meta': {}, 'meta_raw': '{"tag":"","tags":["mktp","mktp:2.00"],"app_id":24560,"gttp":null,"iceberg":{"leg":0,"legs":0,"leg_quantity":0,"total_quantity":0,"remaining_quantity":0},"validity_ttl":0,"aucno":"","kite_order_id":"","_kite":{"user":{"silo":"i","poa":"physical","twofa_type":"totp"},"silo":"i"}}', 'tag': None, 'tags': ['mktp', 'mktp:2.00'], 'guid': None}, {'account_id': 'XXXX', 'placed_by': 'XXXX', 'terminal_id': '1111111111111088', 'order_id': '2042130686722629633', 'exchange_order_id': '1775716697818879783', 'parent_order_id': None, 'status': 'OPEN', 'status_message': None, 'status_message_raw': None, 'order_timestamp': datetime.datetime(2026, 4, 9, 12, 11, 11), 'exchange_update_timestamp': '2026-04-09 12:11:11', 'exchange_timestamp': datetime.datetime(2026, 4, 9, 12, 11, 11), 'variety': 'regular', 'modified': False, 'exchange': 'BFO', 'tradingsymbol': 'SENSEX2640977100CE', 'instrument_token': 221837573, 'order_type': 'LIMIT', 'transaction_type': 'SELL', 'validity': 'DAY', 'validity_ttl': 0, 'product': 'NRML', 'quantity': 20, 'disclosed_quantity': 0, 'price': 204.1, 'trigger_price': 0, 'average_price': 0, 'filled_quantity': 0, 'pending_quantity': 20, 'cancelled_quantity': 0, 'market_protection': 0, 'meta': {}, 'meta_raw': '{"tag":"","tags":["mktp","mktp:2.00"],"app_id":24560,"gttp":null,"iceberg":{"leg":0,"legs":0,"leg_quantity":0,"total_quantity":0,"remaining_quantity":0},"validity_ttl":0,"aucno":"","kite_order_id":"","_kite":{"user":{"silo":"i","poa":"physical","twofa_type":"totp"},"silo":"i"}}', 'tag': None, 'tags': ['mktp', 'mktp:2.00'], 'guid': None}, {'account_id': 'XXXX', 'placed_by': 'XXXX', 'terminal_id': '1111111111111088', 'order_id': '2042130686722629633', 'exchange_order_id': '1775716697818879783', 'parent_order_id': None, 'status': 'CANCEL PENDING', 'status_message': None, 'status_message_raw': None, 'order_timestamp': datetime.datetime(2026, 4, 9, 12, 12, 20), 'exchange_update_timestamp': '2026-04-09 12:11:11', 'exchange_timestamp': datetime.datetime(2026, 4, 9, 12, 11, 11), 'variety': 'regular', 'modified': False, 'exchange': 'BFO', 'tradingsymbol': 'SENSEX2640977100CE', 'instrument_token': 221837573, 'order_type': 'LIMIT', 'transaction_type': 'SELL', 'validity': 'DAY', 'validity_ttl': 0, 'product': 'NRML', 'quantity': 20, 'disclosed_quantity': 0, 'price': 204.1, 'trigger_price': 0, 'average_price': 0, 'filled_quantity': 0, 'pending_quantity': 20, 'cancelled_quantity': 0, 'market_protection': 0, 'meta': {}, 'meta_raw': '{"_kite":{"silo":"i","user":{"poa":"physical","silo":"i","twofa_type":"totp"}},"app_id":24560,"aucno":"","gttp":null,"iceberg":{"leg":0,"leg_quantity":0,"legs":0,"remaining_quantity":0,"total_quantity":0},"kite_order_id":"","silo":"i","tag":"","tags":["mktp","mktp:2.00"],"user":{"silo":"i","poa":"physical","twofa_type":"totp"},"validity_ttl":0}', 'tag': None, 'tags': ['mktp', 'mktp:2.00'], 'guid': None}, {'account_id': 'XXXX', 'placed_by': 'XXXX', 'terminal_id': '1111111111111088', 'order_id': '2042130686722629633', 'exchange_order_id': '1775716697818879783', 'parent_order_id': None, 'status': 'CANCELLED', 'status_message': None, 'status_message_raw': None, 'order_timestamp': datetime.datetime(2026, 4, 9, 12, 12, 20), 'exchange_update_timestamp': '2026-04-09 12:12:20', 'exchange_timestamp': datetime.datetime(2026, 4, 9, 12, 12, 20), 'variety': 'regular', 'modified': False, 'exchange': 'BFO', 'tradingsymbol': 'SENSEX2640977100CE', 'instrument_token': 221837573, 'order_type': 'LIMIT', 'transaction_type': 'SELL', 'validity': 'DAY', 'validity_ttl': 0, 'product': 'NRML', 'quantity': 20, 'disclosed_quantity': 0, 'price': 204.1, 'trigger_price': 0, 'average_price': 0, 'filled_quantity': 0, 'pending_quantity': 20, 'cancelled_quantity': 0, 'market_protection': 0, 'meta': {}, 'meta_raw': '{"_kite":{"silo":"i","user":{"poa":"physical","silo":"i","twofa_type":"totp"}},"app_id":24560,"aucno":"","gttp":null,"iceberg":{"leg":0,"leg_quantity":0,"legs":0,"remaining_quantity":0,"total_quantity":0},"kite_order_id":"","silo":"i","tag":"","tags":["mktp","mktp:2.00"],"user":{"silo":"i","poa":"physical","twofa_type":"totp"},"validity_ttl":0}', 'tag': None, 'tags': ['mktp', 'mktp:2.00'], 'guid': None}
To determine how much of the order was executed before cancellation, we suggest comparing the quantity (total quantity placed) and filled_quantity (quantity that got filled) fields from the Retrieving Orders API response. If filled_quantity is 0, it means no part of the order was executed before the cancellation.
Regarding polling — After you/your code initiates a cancellation request, you can poll the order status using this endpoint until the status transitions to a CANCELLED state.