A court document released on Wednesday said Hernandez, 25, was denied an appeal by a Madrid criminal court against a previous suspended prison sentence for defying the no-contact order.
The document said that the France international was refused the appeal because he had already been sentenced to two criminal convictions, both related to the incident of February 2017.
Representatives for Bayern and Hernandez did not immediately respond to a request for comment from Reuters.
He was ordered to appear in court in Madrid on October 19, after which he has 10 days to enter prison voluntarily.
Hernandez has appealed the latest order.
He was sentenced to 31 days of community service for assaulting his then girlfriend and now his wife in February 2017, while playing for Atletico Madrid.
He also received an injunction preventing him from being within 500 meters of his partner, who was also sentenced to 31 days of community service for violence, assault and property damage.
Hernandez was arrested in June 2017 for defying the restraining order after landing in Madrid with his wife after their wedding and honeymoon.
Hernandez made his professional debut for Atletico in 2014 before joining Bayern in 2019 for € 80million. He made 29 appearances for France, winning the 2018 World Cup and lift the 2021 UEFA Nations League trophy on Sunday.