The Messenger of Allah ﷺ arrived in Medina and found people paying in advance for fruit. He said, "Whoever pays in advance, let him do so for a specified measure, a specified weight, and a specified term."
حدثنا أحمد بن منيع حدثنا سفيان عن ابن أبي نجيح عن عبد الله بن كثير عن أبي المنهال
قدم رسول الله ﷺ المدينة وهم يسلفون في الثمر فقال من أسلف فليسلف في كيل معلوم ووزن معلوم إلى أجل معلوم
Agreed upon by Bukhari and Muslim. Bukhari narrated it in the Book of Salam, in the chapter on advance payment for a known weight, hadith no. 2240, and Muslim, hadith no. 1604, from the hadith of Sufyan bin Uyayna, with this wording.On this topic, there are also narrations from Ibn Abu Awfa [Bukhari, no. 2242, 2243] and Abdul-Rahman bin Abza [Bukhari, no. 2242, 2243].