Getting a ressource ID, from a WC_Order_Item_Product/Order

For existing orders, you need to use the wc_get_order() function.