It was narrated that Ibn 'Abbas said:
"When the Prophet (ﷺ) came (to Al-Madinah), they used to pay in advance for dates, two or three years in advance. He said: 'Whoever pays in advance for dates, let him pay for a known amount or a known weight, to be delivered at a known time.'" (DE)
English reference (DE): Vol. 3, Book 12, Hadith 2280 (DE)
Arabic reference (DE): Book 12, Hadith 2366 (DE)