Sayyiduna Umar (may Allah be pleased with him) narrates from Sayyiduna Bilal (may Allah be pleased with him). Bilal (may Allah be pleased with him) said: I had some dates belonging to the Messenger of Allah (peace and blessings be upon him), and they went bad. So I took them to the market and sold two sa' for one sa'. Then when I brought some of those (new dates) to him (peace and blessings be upon him), he (peace and blessings be upon him) said: "What is this, O Bilal?" I told him, and he (peace and blessings be upon him) said: "Wait, cancel this sale, then sell the dates for gold, silver or wheat, then buy dates with it." Then the Messenger of Allah (peace and blessings be upon him) said: "Dates for dates, like for like; wheat for wheat, like for like; gold for gold, weight for weight; and silver for silver, weight for weight (are to be sold). And when the two kinds differ, there is no harm in one for ten."
Hadith Referenceالمعجم الكبير للطبراني / باب الباء / 1013
Sa'id bin al-Musayyib narrates from Sayyiduna Bilal (may Allah be pleased with him). Bilal (may Allah be pleased with him) said: I had some inferior dates, so with them I bought from the market better dates than them in half their quantity. Then I brought them to the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) said: "I have not seen better dates than these today. Where did you get these, O Bilal?" I told him what I had done, and he (peace and blessings be upon him) said: "Go and return these to their owner and take back your (original) dates, then sell them for wheat or barley, then buy these dates with that, then bring them to me." So I did that. Then the Messenger of Allah (peace and blessings be upon him) said: "Dates for dates, like for like; wheat for wheat, like for like; barley for barley, like for like; salt for salt, like for like; gold for gold, like for like, by weight; and silver for silver, like for like, by weight; and whatever is extra is usury (riba)."
Hadith Referenceالمعجم الكبير للطبراني / باب الباء / 1014