How to get order id in Python

I want to cancel a order but I cant get the order id, I tried:

buy_order = buy(symbolTicker,qty,price) #buy is a function that I made (works ok)
result = client.cancel_order(

and return me Nonetype object has no attribute get
Anyone know how I can get it ?

Hi @Tomas_Marmay,

this is a programming question which is not exactly the intention on this forum (more focused on the API itself), but you should probably print buy_order to see if the saved data from the buy order is what you expect, should look similar to examples on, then query “orderId”.

Ok sorry and thnk u