A court document released on Wednesday said Hernandez, 25, had been denied an appeal by a criminal court in Madrid against a previous suspended prison sentence for defying the restraining order.
The document said the France international had been denied the appeal as he had been given two previous criminal sentences, both relating to the February 2017 incident.
Bayern and Hernandez's representatives did not immediately respond to a request for comment from Reuters.
He has been ordered to attend court in Madrid on Oct. 19, from which he has 10 days to voluntarily enter prison.
Hernandez has appealed against the latest order.
He was sentenced to 31 days community service for assaulting his then girlfriend and now wife in February 2017, when he played for Atletico Madrid.
He was also given a restraining order preventing him from being within 500 metres of his partner, who was also given 31 days community service for violence, assault and damage to property.
Hernandez was arrested in June 2017 for defying the restraining order after landing in Madrid along with his wife following their marriage and honeymoon.
Hernandez made his professional debut for Atletico in 2014 before joining Bayern in 2019 for €80 million. He has made 29 appearances for France, winning the 2018 World Cup and lifting the 2021 UEFA Nations League trophy on Sunday.