The Prophet ﷺ arrived in Medina, where the people were paying in advance for fruit a year or two ahead. He said, "Whoever pays in advance for fruit must do so for a specified measure, a specified weight, and a specified term."
قدم النبي ﷺ المدينة، وهم يسلفون في الثمار السنة والسنتين، فقال: من أسلف في ثمر فليسلف في كيل معلوم، ووزن معلوم، إلى أجل معلوم.
Bukhari narrated it in the Book of Salam (2240), and Muslim in the Book of Musaqah (1604: 127), both through the route of Sufyan bin Uyayna, who said, Ibn Abu Najeeh informed us, from Abdullah bin Kathir, from Abu Minhal, from Ibn Abbas, and he mentioned it. The wording given here is Muslim's.His saying, "salaf," this is the dialect of Hijaz, while "salam" is the dialect of Iraq. Salaf has two meanings in transactions. The first is a loan from which the lender derives no benefit, and which the borrower is obligated to return just as he took it. The second is the well known salam contract, which is the handing over of immediate payment in exchange for something with a described specification owed as a debt. It is said, "I gave salaf," "I gave in salaf form," and "I gave in salam form," all with the same meaning.His saying, "in dates." Nawawi said in his commentary (11/42–43), "This is how it appears in most manuscripts, 'tamr' (dates) with the letter ta, while in some it appears as 'thamr' (fruit) with the letter tha, which is more general, and this is the case in all the copies."This hadith provides evidence for the permissibility of the salaf contract in food, clothing, and other kinds of commercial goods whose measure and description are known.