The third-seeded Argentine was trailing Austria's Jurgen Melzer 7-5, 2-1 in his second-round match when he retired with an injury to his right wrist.
Del Potro said that he suffered from similar wrist tendinitis earlier this year.
"It's a big tournament here in Shanghai, very important for me," del Potro said. "But if I want to have a good finish this season, I had to recover, go home to be in good shape for the last tournaments."
Del Potro has already qualified for the eight-man, season-ending ATP World Tour Finals next month in London.
The Argentine's departure followed that of German Tommy Haas earlier in Wednesday's play.
The 15th-seeded Haas lost the first set 6-4 to qualifier and compatriot Rainer Schuettler when he retired with a right shoulder injury.
On Tuesday, fourth-seeded Andy Roddick retired from his match against Stanislas Wawrinka of Switzerland with a left knee injury.
Prior to the tournament's start, world No. 1 Roger Federer withdrew citing fatigue, and Andy Murray pulled out as well with a left wrist injury.
Since winning the U.S. Open last month, del Potro has not been at his best. Last week, he lost to French qualifier Edouard Roger-Vasselin in the first round at the Japan Open in Tokyo.
Del Potro hoping to build on U.S. Open successAlonso receives injury boost