Diego Tristan scored the only goal of the game in the 32nd minute with a superb free-kick from 20 yards.
It was only his third goal for the club and came following a foul from Abdoulaye Faye on David Michele.
Stoke started well and pushed forward in the ninth minute. Rory Delap picked out Ryan Shawcross with a long throw but his header was safely taken by Robert Green.
Ricardo Fuller then found the net for the home side two minutes later after beating Green to the ball but his effort was disallowed.
The visitors made the breakthrough in the 32nd minute. Tristan was celebrating after delivering a superb free-kick from 20 yards beyond goalkeeper Thomas Sorensen.
Stoke responded and almost equalised in the 40th minute. Matthew Etherington laid the ball off to Fuller, who looked odds-on to score but Green reacted well to take the ball off his toes as he prepared to shoot.
Then Delap and Luis Boa Morte were booked after a tussle a minute before half-time and the match was becoming feisty.
Liam Lawrence thought he had won a penalty for Stoke in first-half stoppage time after a challenge from Radoslav Kovac only to get a yellow card for diving. Fuller then clipped a shot wide of the post in the 59th minute.
West Ham were playing some neat football in the middle of the park, but Stoke came close to equalising in the 74th minute when Lawrence delivered a corner from the left, but Abdoulaye Faye's header was cleared off the line.