Ayesha reported,

Ayesha said, Barirah came to me and said, "I have made a contract with my masters to buy my freedom for nine ounces of silver, one ounce each year. So help me."I said to her, "If your masters are willing for me to pay the entire amount at once and for your loyalty as a freed slave to belong to me, I will do it."Barirah went to her masters and told them, but they refused. She returned, while the Messenger of Allah ﷺ was seated, and said, "I presented your offer to them, but they refused unless the right of loyalty goes to them."The Prophet ﷺ heard this, and Ayesha informed the Prophet ﷺ of what had happened. He said, "Take her and let them stipulate the right of loyalty for themselves, for the right of loyalty belongs only to the one who frees the slave."So Ayesha did so. Then the Messenger of Allah ﷺ stood among the people, praised Allah and glorified Him, then said, "Now then, what is the matter with Some men who impose 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 judgment of Allah is more deserving, and the condition of Allah is more binding, and the right of loyalty belongs only to the one who frees the slave."

Azami 5858

Sahih

عن عائشة قالت

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

الأعظمي 5858صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Sales
Chapter
Prohibited sales
Section
One who stipulates a condition not in the Book of Allah, the sale is valid and the condition is void
Numbering
Jami al-Kamil 5858 (2nd edition)
Azami 5858