The Messenger of Allah ﷺ used to say, "Do not buy or sell fruit until its soundness becomes apparent." He forbade this to both the seller and the buyer.The Messenger of Allah ﷺ also forbade muzabanah, which is for a man to sell the fruit of his orchard, if it consisted of date-palms, for a measured quantity of dried dates, or if it was a vineyard, to sell it for a measured quantity of raisins, or if it was a standing crop, to sell it for a measured quantity of grain. He forbade all of that.
حدثنا يونس حدثنا ليث عن نافع
عن رسول الله ﷺ أنه كان يقول لا تتبايعوا الثمرة حتى يبدو صلاحها نهى البائع والمشتري ونهى رسول الله ﷺ عن المزابنة أن يبيع ثمرة حائطه إن كانت نخلا بتمر كيلا وإن كانت كرما أن يبيعه بزبيب كيلا وإن كانت زرعا أن يبيعه بكيل معلوم نهى عن ذلك كله
Its isnad is sahih. Its meaning has already appeared scattered across many hadiths, including 4490, 4528, 5320, 5523, 5862, and 5863. Muslim (1:450) also narrated the prohibition of muzabana, in a similar wording, from Qutayba and Muhammad bin Rumh, both from Layth bin Saad, with this same isnad.