Sunnah.com reference : Book 7, Hadith 66English translation : Book 7, Hadith 836Arabic reference : Book 7, Hadith 833
Narrated 'Ubadah bin as-Samit (RA):
Allah's Messenger (ﷺ) said: "Gold is to be paid for with gold, silver with silver, wheat with wheat, barley with barley, dates with dates, and salt with salt, same quantity for same quantity and equal for equal, hand to hand (i.e. payment being made on the spot). If these classes differ, sell as you wish as long as payment is made on the spot."

[Reported by Muslim].
وَعَنْ عُبَادَةَ بْنِ اَلصَّامِتِ ‏- رضى الله عنه ‏- قَالَ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ اَلذَّهَبُ بِالذَّهَبِ, وَالْفِضَّةُ بِالْفِضَّةِ, وَالْبُرُّ بِالْبُرِّ, وَالشَّعِيرُ بِالشَّعِيرِ, وَالتَّمْرُ بِالتَّمْرِ, وَالْمِلْحُ بِالْمِلْحِ, مِثْلًا بِمِثْلٍ, سَوَاءً بِسَوَاءٍ, يَدًا بِيَدٍ, فَإِذَا اِخْتَلَفَتْ هَذِهِ اَلْأَصْنَافُ فَبِيعُوا كَيْفَ شِئْتُمْ إِذَا كَانَ يَدًا بِيَدٍ }  رَوَاهُ مُسْلِمٌ  1‏ .‏‏1 ‏- صحيح.‏ رواه مسلم ( 1587 )‏ ( 81 )‏.‏