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

Question

The end goal here is a plugin so that when an item is added or updated in WooCommerce I call a custom function to retrieve additional data from an API. For example, if I wanted to add the ISBN 1119327776 I would create a new product with that SKU, and then when I click publish I would call the Amazon Product Advertising API to collect and insert title, description, dimensions, etc. The problem is I am getting stuck on where and how to actually add the action. I have tried:

//test wp_update_post add_action hook
function update_test() {
echo "this was a success!";
}

function update_test() {
echo "this was a success!";
}

function update_test() {
echo "this was a success!";
}


add_action( "save_post_product", "make_api_call" );
function make_api_call( $post_id ) {$datas["ID"]         = $post_id;$datas["post_title"] = "this title was reset";