كتاب البيوع
21  
The Book of Transactions
(10)
Chapter: Affirming that both parties to a transaction have the option (of canceling it) while they are still together
(10)
باب ثُبُوتِ خِيَارِ الْمَجْلِسِ لِلْمُتَبَايِعَيْنِ ‏‏
Sahih Muslim 1531 c

Ibn 'Umar (Allah be pleased with thcm) reported Allah's Messenger (ﷺ) as saying:

When two persons enter into a transaction, each of them has the right to annul it so long as they are not separated and are together (at the place of transaction) ; or if one gives the other the right (to annul the transaction) But if one gives the other the option, the transaction is made on this condition (i. e. one has the right to annul the transaction), it becomes binding. And if they are separated after they have made the bargain and none of them annulled it, even then the transaction is binding.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ إِذَا تَبَايَعَ الرَّجُلاَنِ فَكُلُّ وَاحِدٍ مِنْهُمَا بِالْخِيَارِ مَا لَمْ يَتَفَرَّقَا وَكَانَا جَمِيعًا أَوْ يُخَيِّرُ أَحَدُهُمَا الآخَرَ فَإِنْ خَيَّرَ أَحَدُهُمَا الآخَرَ فَتَبَايَعَا عَلَى ذَلِكَ فَقَدْ وَجَبَ الْبَيْعُ وَإِنْ تَفَرَّقَا بَعْدَ أَنْ تَبَايَعَا وَلَمْ يَتْرُكْ وَاحِدٌ مِنْهُمَا الْبَيْعَ فَقَدْ وَجَبَ الْبَيْعُ ‏"‏ ‏.
Reference : Sahih Muslim 1531c
In-book reference : Book 21, Hadith 54
USC-MSA web (English) reference : Book 10, Hadith 3658
  (deprecated numbering scheme)