Ruiz Jr will bank just £5million after producing one of the greatest heavyweight upsets in history at Madison Square Garden.
The Mexican underdog knocked the Brit down four times, forcing a seventh-round stoppage.
Joshua will accrue £20m after suffering the first defeat of his career.
Joshua struggled to gain a foothold in the early rounds, but found a breakthrough in the third, flooring Ruiz Jr with a left hook.
The challenger recovered and showed slick hand speed to knock Joshua down twice before the end of the round with chopping right hooks to the temple.
The 29-year-old staggered back to his stool and regained composure in the following rounds, but was knocked down twice more in the seventh, leaving referee Mike Griffin with no choice but to stop the fight.
Ruiz Jr stepped in to take the fight with just five weeks’ notice after Joshua’s original opponent Jarrell Miller failed a drugs test.
The Mexican accepted the £5m offer before the bout, over five times more than the £770,000 he received after the loss to Joseph Parker in 2017.
The most Ruiz Jr has earned for a win was a reported £382,000 against Devin Vargas in 2018.
Joshua described the loss as merely a ‘minor setback,’ with promoter Eddie Hearn expecting to arrange a rematch for December.