Allah's Messenger (ﷺ) said, "Both the buyer and the seller have the option of canceling or confirming a bargain unless they separate, or the sale is optional." (See Hadith No.320).

Sahih al-Bukhari Book 34, Hadith 64