How do you add a custom function to add / update product?

This code does in fact work. In the question I created an edit that talked about it timing out. That was due to the infinite loop that was created. The following code fixes that problem.

function make_api_call( $post_id ) {
    //unhook to avoid infinite loop
    remove_action( "save_post_product", "make_api_call" );

    //make API call and pass data into update array
    $update["ID"]           = $post_id;
    $update["post_title"]   = "this title was reset";

    //update the post
    wp_update_post( $update );

    //re-hook the disabled function
    add_action( "save_post_product", "make_api_call" );
}

add_action( "save_post_product", "make_api_call" );