It is narrated from Sayyiduna Samurah bin Jundub (may Allah be pleased with him) that "the Prophet (peace and blessings be upon him) forbade selling an animal for an animal on credit."
However, most of the hadith masters do not affirm that al-Hasan al-Basri heard from Samurah, except in the hadith of the aqiqah. Some jurists interpreted it as selling one for the other with credit on both sides, which would be a debt for a debt, and that is not permissible.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 10532
Ikrimah narrates from Ibn Abbas (may Allah be pleased with them both) that "the Prophet (peace and blessings be upon him) forbade selling an animal for an animal on credit."
Narrating it from Ma'mar as connected (mawsul) is, in all its routes, an error (wahm); the correct version is the following, mursal one.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 10533
(It is narrated) from Ma'mar, from Yahya, from Ikrimah, from the Prophet (peace and blessings be upon him) as mursal (without mention of the Companion). Sufyan also narrated it from Ma'mar as mursal; likewise Abd al-Razzaq and Abd al-A'la narrated it from Ma'mar, and likewise Ali bin al-Mubarak narrated it from Yahya bin Abi Kathir, from Ikrimah, from the Prophet (peace and blessings be upon him) as mursal.
It has reached us from al-Bukhari that he declared weak the narration of those who narrated it as connected.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 10534
Rabi' bin Sulayman (may Allah have mercy on him) said that Imam al-Shafi'i (may Allah have mercy on him) said: As for the statement (attributed to) the Prophet (peace and blessings be upon him) that "he (peace and blessings be upon him) forbade selling an animal for an animal on credit," this is not established from him (peace and blessings be upon him).
Abu Bakr Muhammad bin Ishaq bin Khuzaymah said: What is correct according to the experts in hadith is that this report is mursal, not connected.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 10535