how to get term id from current post type instead of name

get_the_terms()
will help you. Function return array with terms objects and you can foreach array and retrieve term id for each term attached to post.