The 27-year-old Ramis had been linked with a number of English clubs but West Ham look poised to make him their latest summer signing.
A statement on Real Mallorca's official website read: "Mallorca and West Ham have reached an agreement for the transfer of Ivan Ramis. The Mallorcan defender has the permission of the club to have a medical with what will be his new team."
Mallorca did not mention any fee for Ramis but said they will "achieve the economic objective for which they have been working for over recent weeks."
Mallorca-born Ramis came up through the youth ranks at his local club and, aside from a spell on loan at Real Valladolid in 2005/06, has spent the last eight seasons with the senior team.
Ramis announced earlier this month his desire to join a Barclays Premier League team and he has received support from Mallorca in his bid to move to England.
The Spanish club added in their statement: "From the board led by Jaume Cladera and Lorenzo Serra Ferrer, the coaching staff directed by Joaquin Caparros, all his team-mates in the changing room, employees of the club and everyone associated with Real Mallorca want to wish Ivan the best of luck in this new stage of his career that he will begin."
If Ramis completes his move to West Ham he will join a host of new faces at Upton Park this summer, with manager Sam Allardyce having already brought in goalkeepers Jussi Jaaskelainen, Stephen Henderson and Raphael Spiegel, midfielder Mohamed Diame and forward Modibo Maiga.
- Real Mallorca