Do Margin Trading Facility gets auto enabled via orders placed through API?

Hi Upstox Team,

Today while testing my Algo System, I encountered 1 strange thing, I had funds of only 2911 (only able to buy 1 stock of reliance)

But after placing the 1st short sell order, my system got disconnected from the market data websocket due to some code issue, and after some seconds of lapse time it again connected itself to the websocket, and again it placed the same short sell order

Not sure how but both the order got executed succesfully, How was this possible when I had funds only worth just 1 stock.

Was the Margin Trading Facility got auto enabled for these orders?

NOTE:- MTF is not activated for my account

Thank you for contacting us. Please note that the margin facility won’t be activated automatically.

To assist you further, could you provide your UCC and order number? We will look into this and get back to you asap.

type or paste code here

Hi Pradeep,
My UCC is CE5464.
Please find my order details below
1st Order response received from Get Order History API:-

2023-11-21 13:17:01.209137
{'status': 'success', 'data': 
[
{'exchange': 'NSE', 'price': 2380.05, 'product': 'I', 'quantity': 1, 'status': 'put order req received', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': None, 'exchange_timestamp': None, 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000433922', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:17:00', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.05, 'product': 'I', 'quantity': 1, 'status': 'validation pending', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': None, 'exchange_timestamp': None, 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000433922', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:17:00', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.05, 'product': 'I', 'quantity': 1, 'status': 'open pending', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': None, 'exchange_timestamp': None, 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000433922', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:17:00', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.05, 'product': 'I', 'quantity': 1, 'status': 'open', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': '1300000024115059', 'exchange_timestamp': '2023-11-21 13:17:00', 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000433922', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:17:00', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.05, 'product': 'I', 'quantity': 1, 'status': 'open', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': '1300000024115059', 'exchange_timestamp': '2023-11-21 13:17:00', 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000433922', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:17:00', 'filled_quantity': 1, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.05, 'product': 'I', 'quantity': 1, 'status': 'complete', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 2380.3, 'disclosed_quantity': 0, 'exchange_order_id': '1300000024115059', 'exchange_timestamp': '2023-11-21 13:17:00', 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000433922', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:17:00', 'filled_quantity': 1, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}
]}

2nd Order response received from Get Order History API:-

2023-11-21 13:18:01.444853
{'status': 'success', 'data': 
[
{'exchange': 'NSE', 'price': 2380.25, 'product': 'I', 'quantity': 1, 'status': 'put order req received', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': None, 'exchange_timestamp': None, 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000435714', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:18:01', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.25, 'product': 'I', 'quantity': 1, 'status': 'validation pending', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': None, 'exchange_timestamp': None, 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000435714', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:18:01', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.25, 'product': 'I', 'quantity': 1, 'status': 'open pending', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': None, 'exchange_timestamp': None, 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000435714', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:18:01', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.25, 'product': 'I', 'quantity': 1, 'status': 'open', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': '1300000024191538', 'exchange_timestamp': '2023-11-21 13:18:01', 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000435714', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:18:01', 'filled_quantity': 0, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.25, 'product': 'I', 'quantity': 1, 'status': 'open', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 0.0, 'disclosed_quantity': 0, 'exchange_order_id': '1300000024191538', 'exchange_timestamp': '2023-11-21 13:18:01', 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000435714', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:18:01', 'filled_quantity': 1, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}, 
{'exchange': 'NSE', 'price': 2380.25, 'product': 'I', 'quantity': 1, 'status': 'complete', 'tag': 'FIRE', 'validity': 'IOC', 'average_price': 2380.25, 'disclosed_quantity': 0, 'exchange_order_id': '1300000024191538', 'exchange_timestamp': '2023-11-21 13:18:01', 'instrument_token': 'NSE_EQ|INE002A01018', 'is_amo': False, 'status_message': None, 'order_id': '231121000435714', 'order_request_id': '1', 'order_type': 'LIMIT', 'parent_order_id': 'NA', 'tradingsymbol': 'RELIANCE', 'trading_symbol': 'RELIANCE', 'order_timestamp': '2023-11-21 13:18:01', 'filled_quantity': 1, 'transaction_type': 'SELL', 'trigger_price': 0.0, 'placed_by': None, 'variety': None}
]}

Looks like this is due to leverage. is there any way to disable leverage on the account?
Please let me know the steps to disable the leverage on my account.

@CE5464

Certainly, this situation arises because of the leverage provided for intraday orders. Regrettably, the option to turn off leverage for particular accounts is unavailable.