thank you for the help brother and let me share you the details you needed
here is the code of place order
“try:
logging.info(“Placing order…”)
response = dhan.place_order(
security_id=‘873451’,
exchange_segment=dhan.NSE_FNO,
transaction_type=dhan.BUY,
quantity=175,
order_type=dhan.MARKET,
product_type=dhan.INTRA,
price=0
)
logging.info(“Order placed successfully.”)
print(f"Order Response: {response}”)
except Exception as e:
logging.error(“Error placing order: %s”, e)
print(f"Error placing order: {e}“)”
so the id used for place order is 873451
and the symbol is for this id TCS 27 JUN 3850 CALL
and i tried 3-4 times using this security id but everytime i get error and when i change the security id for hdfcbank then my order is placed
seccurity id 2023680
symbol name HDFCBANK 27 JUN 1710 PUT
so when i try to place order in hdfc 1710 put then my code will placing order successfully without any issue and i also checked the lot size in case if i make mistake but it is also correct
“try:
logging.info(“Placing order…”)
response = dhan.place_order(
security_id=‘2023680’,
exchange_segment=dhan.NSE_FNO,
transaction_type=dhan.BUY,
quantity=550,
order_type=dhan.MARKET,
product_type=dhan.INTRA,
price=0
)
logging.info(“Order placed successfully.”)
print(f"Order Response: {response}”)
except Exception as e:
logging.error(“Error placing order: %s”, e)
print(f"Error placing order: {e}“)”
and now let me share you some more screenshot with excat log massage so you can help me better way so here is the github repo like that will contain the logs and reports of the todays date so here is the url
final words for failed order place
so error message “TRANSACTION FAIL”
SECURITY ID: 873451
SYMBOL NAME: TCS 27 JUN 3850 CALL
LOT SIZE: 175
SECURITY ID: 875018
SYMBOL NAME: ONGC 27 JUN 267.5 PUT
LOT SIZE: 1925
SUCCESSFUL ORDER IDS
SECURITY ID: 128204
SYMBOL: TITAN 27 JUN 3400 PUT
SECURITY ID: 90206
SYMBOL: HDFCBANK 27 JUN 1700 PUT
so i didnt change any code i only just change security id and lot size in my code and still i got errors on some security ids and with some of the security ids it works without any issue and below is the json of the failed order
{
“SEM_EXM_EXCH_ID”: “BSE”,
“SEM_SEGMENT”: “D”,
“SEM_SMST_SECURITY_ID”: “875018”,
“SEM_INSTRUMENT_NAME”: “OPTSTK”,
“SEM_EXPIRY_CODE”: “0”,
“SEM_TRADING_SYMBOL”: “ONGC-Jun2024-267.5-PE”,
“SEM_LOT_UNITS”: “1925.0”,
“SEM_CUSTOM_SYMBOL”: “ONGC 27 JUN 267.5 PUT”,
“SEM_EXPIRY_DATE”: “2024-06-27 15:30:00”,
“SEM_STRIKE_PRICE”: “267.50000”,
“SEM_OPTION_TYPE”: “PE”,
“SEM_TICK_SIZE”: “5.0000”,
“SEM_EXPIRY_FLAG”: “M”,
“SEM_EXCH_INSTRUMENT_TYPE”: “OPTSTK”,
“SEM_SERIES”: “”,
“SM_SYMBOL_NAME”: “ONGCOPT”
}
{
“SEM_EXM_EXCH_ID”: “BSE”,
“SEM_SEGMENT”: “D”,
“SEM_SMST_SECURITY_ID”: “873451”,
“SEM_INSTRUMENT_NAME”: “OPTSTK”,
“SEM_EXPIRY_CODE”: “0”,
“SEM_TRADING_SYMBOL”: “TCS-Jun2024-3850-CE”,
“SEM_LOT_UNITS”: “175.0”,
“SEM_CUSTOM_SYMBOL”: “TCS 27 JUN 3850 CALL”,
“SEM_EXPIRY_DATE”: “2024-06-27 15:30:00”,
“SEM_STRIKE_PRICE”: “3850.00000”,
“SEM_OPTION_TYPE”: “CE”,
“SEM_TICK_SIZE”: “5.0000”,
“SEM_EXPIRY_FLAG”: “M”,
“SEM_EXCH_INSTRUMENT_TYPE”: “OPTSTK”,
“SEM_SERIES”: “”,
“SM_SYMBOL_NAME”: “TCSLOPT”
}
well

i think i found the problem

why it is showing “TRANSATION FAIL” error but let’s make sure that it’s the lsat peace of the puzzle

i noticed the security id is for BSE stock and in my place order code i select NSE
“exchange_segment=dhan.NSE_FNO,”
but still thank you for the help brother (@Hardik ) cause if you didn’t ask for json to shayad abhi bhi me kahi aur hii dekhta rehta thank you so much brother