Stojanović was a member of the Slovenian under-17 team and appeared with the squad at the 2012 UEFA European Under-17 Championship, where he scored one goal. He made his senior national team debut versus Colombia on 18 November 2014. At the time he was 19 years, one month and 11 days old and became the youngest debutant in the national team, surpassing the previous record set by Rene Mihelič seven years earlier.