Sayyiduna Samurah bin Jundub (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) forbade selling an animal for another animal on credit. Then Hasan (may Allah have mercy on him) forgot this hadith. And Ja'far (may Allah have mercy on him) did not say that Hasan (may Allah have mercy on him) forgot this hadith.
Brief Explanation
(Commentary on Hadith 2599)
From this hadith, it is prohibited to sell an animal of the same species on credit in exchange for another, such as exchanging a camel for a camel or a slave for a slave. However, if the species are different, then a credit transaction is also permissible.
According to Imam Shafi’i rahimahullah and the majority of scholars, every form is permissible—whether on credit or in cash—even if there is an excess on one side, such as exchanging one camel for two camels. And Imam Shafi’i rahimahullah has interpreted the aforementioned hadith to mean that if both sides are on credit, then this is prohibited.