How to programatically get the product id of newly added product using the commerce form I allow users to create their own products using the default commerce product add form (/admin/commerce/products/add/product). Programatically, I need to get the product ID and do more processing. 

I have a submit handler attached like this (I use it to redirect users to a custom page):

$form['actions']['submit']['#submit'][] = 'my_module_redirect_handler';


However, I don't seem to have any information about the newly added node. How can I obtain it?
Provided that your additional submit handler is invoked after default one (which by looking how you added it, is the case), you can access nid of the node created as follows:  

function my_module_redirect_handler(&amp;$form, &amp;$form_state) {
    $node_id = $form_state['values']['nid'];
}


Now that you have nid you should be able to do required processing.

Hope that helps.