Sahih al Bukhari 2112
Sales and Trade
حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا اللَّيْثُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ " إِذَا تَبَايَعَ الرَّجُلاَنِ فَكُلُّ وَاحِدٍ مِنْهُمَا بِالْخِيَارِ، مَا لَمْ يَتَفَرَّقَا، وَكَانَا جَمِيعًا، أَوْ يُخَيِّرُ أَحَدُهُمَا الآخَرَ فَتَبَايَعَا عَلَى ذَلِكَ، فَقَدْ وَجَبَ الْبَيْعُ، وَإِنْ تَفَرَّقَا بَعْدَ أَنْ يَتَبَايَعَا، وَلَمْ يَتْرُكْ وَاحِدٌ مِنْهُمَا الْبَيْعَ، فَقَدْ وَجَبَ الْبَيْعُ ".
Narrated Ibn `Umar:Allah's Messenger (ﷺ) said, "Both the buyer and the seller have the option of canceling or confirming the bargain, as long as they are still together; and unless they separate or one of them gives the other the option of keeping or returning the things and a decision is concluded then, in which case the bargain is considered final. If they separate after the bargain and none of them has rejected it, then the bargain is rendered final
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.