Narrated Ibn 'Umar:
I would sell camels at Al-Baqi', so I would sell them for Dinar but take in place of them Dirham, and, I would sell for silver and take Dinar in its place. So I went to the Messenger of Allah (ﷺ) and found him leaving the house of Hafsah. I asked him about that and he said: 'There is no harm in that when it (equals) the price.'
[Abu 'Eisa said:] We do not know of this Hadith being Marfu' except from the narration of Simak bin Harb from Sa'eed bin Jubair, from Ibn 'Umar.
Dawud bin Abi Hind narrated this Hadith from Abu Sa'eed bin Jubair, from Ibn 'Umar in Mawquf form.
This is acted upon according to some of the people of knowledge. There is no harm in paying for gold with silver and silver with gold. This is the view of Ahmad and Ishaq. Some of the people of knowledge, among the Companions and others, disliked that.