Sunan Ibn Majah, Book 12, Hadith 54 (Ibn Majah 2190)

It was narrated from 'Uqbah bin 'Amir or Samurah bin Jundab that the Messenger of Allah (ﷺ) said:

"Any man who sells to two men, it is for the one who was first."