St. Louis announced the swap for the first baseman on Wednesday. The Cardinals are sending catcher Carson Kelly, right-handed pitcher Luke Weaver, infielder Andy Young and the club's Compensation Round B selection in the 2019 MLB Draft.
The National League Central franchise will have a news conference to introduce Goldschmidt on Friday in St. Louis.
Goldschmidt, 31, hit .290 with 33 home runs and 83 RBIs in 158 games last season for the Diamondbacks. The six-time All-Star owns a .297 career batting average and has 209 career long balls in eight seasons. Goldschmidt led the National League with 110 walks in 2016. He led the National League with 36 home runs and 125 RBIs in 2013, finishing second in the MVP race.
"This was an extremely difficult decision given how much Paul has meant to our team both on and off the field," Diamondbacks president and CEO Derrick Hall said in a statement.
"He represents everything it means to be a D-back, and we are very thankful to him for all that he has done for our franchise and our fans. We wish him, Amy and their family nothing but the best in the years ahead."
Goldschmidt is due $14.5 million in 2019, the last year on his contract.