Order ID Return Variable Question

If I assign an order to a variable to capture order_id, is that variable set when the order is sent?
Tagged:
If I assign an order to a variable to capture order_id, is that variable set when the order is sent?
Comments
Yes, it can be used in the order.cancel routine.
id = order.algo_buy(....
...
order.cancel(symbol, order_id=id)