Liverpool are set to receive an initial fee of £12million, a figure which could rise depending on the forward's success with his prospective new club.
Carroll played the final match of his season-long loan from Anfield in the Hammers' 4-2 Premier League win over Reading on Sunday.
His seven goals, including a late-season flurry, earned him a call-up to the latest England squad and Hammers boss Sam Allardyce had said keeping him at Upton Park was a priority.
Former club Newcastle and newly-promoted Ligue 1 side Monaco were reportedly keen on the 6ft 3in frontman but a deal is in place to extend his stay in East London.
Carroll moved to Liverpool from Newcastle in a £35million deal in January 2011, but struggled to make his mark on Merseyside and has scored just six Premier League goals for the Reds in 44 games.
Speaking to West Ham's website at the end of his loan spell, Carroll said: "I have enjoyed every minute of being here.
"I have just tried to play my best in every match, score goals and keep myself fit once I got back from the injuries I had and then push on from there.
"I have worked hard to get myself back in the England squad, trying to play my best for West Ham, so I am really pleased about that. I just have to make sure I keep playing well to stay in there.
"I have had a great season here, really enjoyed being part of a great set of lads in the team, with the staff around us and the fans. Everyone has been so welcoming to me. This is a great club."