Zhang had to qualify for the tournament by winning the Shanghai Amateur Masters and got off to a bad start, with Carter making a 117 break.
Nonetheless, he turned the encounter around and emerged with a 6-3 victory from the best-of-11 frame contest.
Lisowski edges out Carter in first round Crucible decider
Next up he faces the altogether more daunting task of facing Ronnie O'Sullivan, who last lost in Shanghai in 2016, also in the second round, to Michael Holt.
However, O'Sullivan has not played since May, when he lost to another amateur, James Cahill, in the first round of the World Championship.
One player to avoid an upset was Ding Junhui, who defeated teenager Zhao Jianbo, by six frames to two, albeit in a fairly lacklustre performance.
After splitting the first four frames between them, the former champion then rattled off four straight to secure victory, but his inexperienced opponent was left ruing a number of presentable chances to cause a stir.
There was no better demonstration of this than in the final frame, when Zhao missed a simple pot on the black to let his older compatriot back in and complete victory.
Elsewhere in Shanghai, Barry Hawkins scraped past Yan Bingtao by six frames to five, but Shaun Murphy and Jack Lisowski recorded altogether more comfortable victories, with 6-1 victories over Lyu Haotian and Wu Yize respectively.
Stephen Maguire crashed out to Xiao Guodong in his match, losing 6-2. The Scot was level at 1-1 after two rames, but proceeded to lose the next four frames, and Guodong sealed victory with a century break in the eighth frame.
World Grand Prix
O'Sullivan: I'm running on empty despite running 16 miles
World Grand Prix
O'Sullivan eases past Carter to reach second round at World Grand Prix