How to use functions from Woocommerce documentation?

// define the woocommerce_api_delete_order callback 
function action_woocommerce_api_delete_order( $id, $instance ) { 
    // make action magic happen here... 
}; 

// add the action 
add_action( 'woocommerce_api_delete_order', 'action_woocommerce_api_delete_order', 10, 2 );