We used to sell mothers of children during the time of the Messenger of Allah ﷺ and Abu Bakr. When Umar came to power, he forbade us, so we stopped.
حدثنا موسى بن إسمعيل حدثنا حماد عن قيس عن عطاء
بعنا أمهات الأولاد على عهد رسول الله ﷺ وأبي بكر فلما كان عمر نهانا فانتهينا
[Its isnad is sahih] Bayhaqi reported it: 10/347, from the hadith of Hammad bin Salama, through this route. Hakim graded it sahih according to the criteria of Muslim: 2/18, 19, and Dhahabi agreed with him. Part of its content has a corroborating witness in Ibn Majah, hadith 2517.Qays is Ibn Saad.