Barrera made his debut for Nicaragua in a January 2009 UNCAF Nations Cup match against El Salvador and has, as of June 2021, earned a total of 62 caps, scoring 21 goals. He has represented his country in 12 FIFA World Cup qualification matches and played at the 2009 and 2011 UNCAF Nations Cups as well as at the 2009, 2017, and 2019 CONCACAF Gold Cups.