Where to put code to get custom taxonomy term id?

In your WP database there a table named wp_terms. There you can see all terms ids (term_id) and all terms names (term_name). That should give you what you need. If you don’t have access to your WP database you can you a plugin to do that. I use one called Adminer, but there are others that do that. Once you install Adminer you can acccess your database from Tools->Adminer – Start Adminer.

Another way to do that is to use the function “get_terms”. But that involves editing one of your wordpress templates (php files).
http://codex.wordpress.org/Function_Reference/get_terms