How can I retrieve the product ID?
According to the docs I found here commerce_product_load_by_sku($sku) will return a $product object and one of the properties is product_id.

$product = commerce_product_load_by_sku($sku);
drupal_set_message($product-&gt;product_id);


The product object looks something like this:

[product_id] =&gt; 5
[sku] =&gt; EX151
[type] =&gt; class
[language] =&gt; und
[title] =&gt; Example Product
[uid] =&gt; 1
[status] =&gt; 1
[created] =&gt; 1316634672
[changed] =&gt; 1316639451
[data] =&gt; 
[commerce_price] =&gt; Array
    (
        [und] =&gt; Array
            (
                [0] =&gt; Array
                    (
                        [amount] =&gt; 12500
                        [currency_code] =&gt; USD
                        [data] =&gt; Array
                            (
                                [components] =&gt; Array
                                    (
                                    )

                            )

                    )

            )

    )