The Messenger of Allah ﷺ said, "The two parties to a transaction each retain the option to cancel as long as they have not parted, unless the sale was made with a stipulated option. If the sale was made with such an option, then the sale is binding."
أخبرنا محمد بن علي المروزي قال حدثنا محرز بن الوضاح عن إسمعيل عن نافع
قال رسول الله ﷺ المتبايعان بالخيار ما لم يفترقا إلا أن يكون البيع كان عن خيار فإن كان البيع عن خيار فقد وجب البيع