Abu Saeed Khudri reported,

Bilal came to the Prophet ﷺ with some Barni dates. The Prophet ﷺ asked him, "Where did these come from?"Bilal replied, "We had some poor-quality dates, so I sold two measures of them for one measure of these in order to feed the Prophet ﷺ."At that, the Prophet ﷺ exclaimed, "Oh no, oh no! This is the very essence of usury, the very essence of usury! Do not do this. Rather, when you want to buy good dates, sell your dates in a separate transaction, then use the proceeds to buy the others."

Bukhari 2312

Sahih

حدثنا إسحاق حدثنا يحيى بن صالح حدثنا معاوية هو ابن سلام عن يحيى قال سمعت عقبة بن عبد الغافر أنه سمع

أبا سعيد الخدري رضي الله عنه قال

جاء بلال إلى النبي ﷺ بتمر برني فقال له النبي ﷺ من أين هذا قال بلال كان عندنا تمر ردي فبعت منه صاعين بصاع لنطعم النبي ﷺ فقال النبي ﷺ عند ذلك أوه أوه عين الربا عين الربا لا تفعل ولكن إذا أردت أن تشتري فبع التمر ببيع آخر ثم اشتره

البخاري 2312صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Agency
Chapter
If the agent sells something defective, the sale is void
Numbering
Darussalam 2312
Bukhari 2312