Upvote:0
If your flights are in one booking, you will pass through a transit immigration check in Shanghai (this goes for all Chinese airports other than Beijing).
If it's on separate bookings, you'll need to clear regular Chinese immigration twice, in order to collect and re-check your luggage.
And of course you have to clear US immigration.
So, two immigration checks if single booking, otherwise three.
Upvote:2
I hope you got a good fare as going from Japan to Shanghai then back over Japan to USA is the long way.
If your flights are on one ticket using partner airlines you should be able to check the bags through from Japan to the USA and baggage rules for the flight to the USA would apply (2 piece rule), so only pay the third bag fee once. No need to go through immigration in Shanghai.
If your flights are on separate tickets you may have to claim and recheck your bags in Shanghai, in which case inter Asia baggage rules apply from Japan to Shanghai which are usually weight not piece based (20 kg I believe). And then piece rules, two free one for a fee from Shanghai to the states. The most significant carrier rule does not apply on separate tickets. You would need to go through immigration.