Ayesha reported,

Barirah came to me and said, "I have made a contract with my owners to buy my freedom for nine ounces, one ounce each year, so help me."Ayesha said, "If they would like me to pay it all to them at once and your loyalty would belong to me, I will do so."Barirah went to her owners and told them this, but they refused. She returned from them while the Messenger of Allah ﷺ was sitting, and she said, "I presented that to them, but they refused unless the right of loyalty remained with them."The Prophet ﷺ heard this, and Ayesha informed the Prophet ﷺ of the matter. He said, "Take her and stipulate for them the right of loyalty, for loyalty belongs only to the one who frees the slave."Ayesha did so. Then the Messenger of Allah ﷺ stood up before the people, praised Allah and extolled Him, then said, "What is the matter with Some men who stipulate conditions that are not in the Book of Allah? Any condition that is not in the Book of Allah is invalid, even if it be a hundred conditions. The decree of Allah is more deserving and the condition of Allah is more binding. Loyalty belongs only to the one who frees the slave."

Bukhari 2729

Sahih

حدثنا إسماعيل حدثنا مالك عن هشام بن عروة عن أبيه

عن عائشة قالت

جاءتني بريرة فقالت كاتبت أهلي على تسع أواق في كل عام أوقية فأعينيني فقالت إن أحبوا أن أعدها لهم ويكون ولاؤك لي فعلت فذهبت بريرة إلى أهلها فقالت لهم فأبوا عليها فجاءت من عندهم ورسول الله ﷺ جالس فقالت إني قد عرضت ذلك عليهم فأبوا إلا أن يكون الولاء لهم فسمع النبي ﷺ فأخبرت عائشة النبي ﷺ فقال خذيها واشترطي لهم الولاء فإنما الولاء لمن أعتق ففعلت عائشة ثم قام رسول الله ﷺ في الناس فحمد الله وأثنى عليه ثم قال ما بال رجال يشترطون شروطا ليست في كتاب الله ما كان من شرط ليس في كتاب الله فهو باطل وإن كان مائة شرط قضاء الله أحق وشرط الله أوثق وإنما الولاء لمن أعتق

البخاري 2729صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Conditions
Chapter
Conditions regarding wala
Numbering
Darussalam 2729
Bukhari 2729