The Brazilian midfielder, 28, joined the Hammers from Lazio for £36m in 2018 - a club record fee at the time.
Anderson had a medical in Rome on Tuesday, having being on the bench for West Ham's 2-2 friendly draw with Dundee last Friday.
He scored 34 goals in 177 appearances during his first spell at Lazio from 2013-2018 and his fee has not been disclosed.
Need a VPN? Or seeking to switch? Then support Tribal Football by clicking here to sign up with our official partners NordVPN. Not only will you receive the best VPN experience, but also great discounts by signing up via Tribal Football. Thanks for your support!