We were with the Messenger of Allah ﷺ on the day of Khaybar selling the Jews an ounce of gold for two or three dinars, when the Messenger of Allah ﷺ said, "Do not sell gold for gold except weight for weight."
حدثنا قتيبة بن سعيد قال حدثنا ليث بن سعد عن عبيد الله بن أبي جعفر عن الجلاح أبي كثير قال حدثني حنش الصنعاني
كنا مع رسول الله ﷺ يوم خيبر نبايع اليهود الأوقية الذهب بالدينارين والثلاثة فقال رسول الله ﷺ لا تبيعوا الذهب بالذهب إلا وزنا بوزن
Its isnad is sahih. Ubaydullah bin Abu Jafar Al-Masri is trustworthy and a jurist, and his hadith appears in all the major collections. However, Abu Hatim reported from Layth that he said, "I did not hear from Ubaydullah, he only wrote to me." The hadith has already appeared at 11432 and 11640.