Language:
كتاب الشروط
54  
Conditions
(17)
Chapter: Al-Mukatab conditions which contradict Allah's Laws
(17)
باب الْمُكَاتَبِ وَمَا لاَ يَحِلُّ مِنَ الشُّرُوطِ الَّتِي تُخَالِفُ كِتَابَ اللَّهِ
Sahih al-Bukhari 2735

Narrated `Amra:

Aisha said that Barirah came to seek her help in the writing of her emancipation. `Aisha said to her, "If you wish, I will pay your masters (your price) and the wala' will be for me." When Allah's Messenger (ﷺ) came, she told him about it. The Prophet (ﷺ) said to her, "Buy her (i.e. Barirah) and manumit (free) her, for the Wala is for the one who manumits." Then Allah's Messenger (ﷺ) ascended the pulpit and said, "What about those people who stipulate conditions which are not in Allah's Laws? Whoever stipulates such conditions as are not in Allah's Laws, then those conditions are invalid even if he stipulated a hundred such conditions."

حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا سُفْيَانُ، عَنْ يَحْيَى، عَنْ عَمْرَةَ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قَالَتْ أَتَتْهَا بَرِيرَةُ تَسْأَلُهَا فِي كِتَابَتِهَا، فَقَالَتْ إِنْ شِئْتِ أَعْطَيْتُ أَهْلَكِ وَيَكُونُ الْوَلاَءُ لِي‏.‏ فَلَمَّا جَاءَ رَسُولُ اللَّهِ صلى الله عليه وسلم ذَكَّرْتُهُ ذَلِكَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ ابْتَاعِيهَا فَأَعْتِقِيهَا، فَإِنَّمَا الْوَلاَءُ لِمَنْ أَعْتَقَ ‏"‏‏.‏ ثُمَّ قَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَلَى الْمِنْبَرِ فَقَالَ ‏"‏ مَا بَالُ أَقْوَامٍ يَشْتَرِطُونَ شُرُوطًا لَيْسَتْ فِي كِتَابِ اللَّهِ مَنِ اشْتَرَطَ شَرْطًا لَيْسَ فِي كِتَابِ اللَّهِ فَلَيْسَ لَهُ، وَإِنِ اشْتَرَطَ مِائَةَ شَرْطٍ ‏"‏‏.‏
Reference : Sahih al-Bukhari 2735
In-book reference : Book 54, Hadith 22
USC-MSA web (English) reference : Vol. 3, Book 50, Hadith 893
  (deprecated numbering scheme)