Sahih al-Bukhari Book 34, Hadith 88
The Prophet (ﷺ) said, "The buyer of foodstuff should not sell it before it has been measured for him."
Isma`il narrated instead, "He should not sell it before receiving it."
The Prophet (ﷺ) forbade the selling of foodstuff before receiving it. I consider that all types of sellings should be done similarly.
I saw the people buy foodstuff randomly (i.e. blindly without measuring it) in the lifetime of Allah's Apostle and they were punished (by beating), if they tried to sell it before carrying it to their own houses.