Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:11690Abū al-Ḥasan ʿAlī b. Aḥmad b. ʿAbdān > Aḥmad b. ʿUbayd > ʿAbdullāh b. al-Ṣaqr > Ibrāhīm b. al-Mundhir > Muḥammad b. Ismāʿīl b. Abū Fudayk > ʿUbaydullāh b. Hurayr from his father from his grandfather Rāfiʿ b. Khadīj

[Machine] The Messenger of Allah, ﷺ , forbade the gaining of a slave until he knows where he is from, and the rest of this matter is mentioned in the book of expenses; where Ash-Shafi'i mentioned this issue in the chapter of the expenses of slaves.  

البيهقي:١١٦٩٠وَأَخْبَرَنَا أَبُو الْحَسَنِ عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ أنبأ أَحْمَدُ بْنُ عُبَيْدٍ ثنا عَبْدُ اللهِ بْنُ الصَّقْرِ ثنا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ ثنا مُحَمَّدُ بْنُ إِسْمَاعِيلَ بْنِ أَبِي فُدَيْكٍ عَنْ عُبَيْدِ اللهِ بْنِ هُرَيْرٍ عَنْ أَبِيهِ عَنْ جَدِّهِ رَافِعِ بْنِ خَدِيجٍ قَالَ

نَهَى رَسُولُ اللهِ ﷺ عَنْ كَسْبِ الْأَمَةِ حَتَّى يُعْلَمَ مِنْ أَيْنَ هُوَ وَبَقِيَّةُ هَذَا الْبَابِ مَذْكُورٌ فِي كِتَابِ النَّفَقَاتِ؛ حَيْثُ ذَكَرَ الشَّافِعِيُّ هَذِهِ الْمَسْأَلَةَ فِي بَابِ نَفَقَةِ الْمَمَالِيكِ