Get Current Custom Taxonomy ID by Post ID

(Probably better to use get_the_terms).

$terms =  wp_get_object_terms( $pid, 'custom_category', array('fields'=>'ids'));

Get an array of term ids (will always been array, even if it is an array of one):

$ids = wp_list_pluck( $terms, 'term_id' );

If you just want one id… then ‘pop’ out the last id:

 $id = array_pop($ids);

See also PHP docs on array_pop here