Sunan Ibn Majah, Book 12, Hadith 2265 (In-Book)

It was narrated from 'Abdullah bin 'Umar that the Messenger of Allah said: "When two men enter into a transaction, each of them has the choice (of annulling it) so long as they have not yet parted and are still together, or one of them has given the option or choice to the other. Once he has accepted the terms of the other, then the transaction is binding. If they part after concluding the transaction and neither of them has rescinded the transaction then the transaction is binding.”

حَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ الْمِصْرِيُّ، أَنْبَأَنَا اللَّيْثُ بْنُ سَعْدٍ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ، عَنْ رَسُولِ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ ‏ "‏ إِذَا تَبَايَعَ الرَّجُلاَنِ فَكُلُّ وَاحِدٍ مِنْهُمَا بِالْخِيَارِ مَا لَمْ يَتَفَرَّقَا وَكَانَا جَمِيعًا أَوْ يُخَيِّرْ أَحَدُهُمَا الآخَرَ فَإِنْ خَيَّرَ أَحَدُهُمَا الآخَرَ فَتَبَايَعَا عَلَى ذَلِكَ فَقَدْ وَجَبَ الْبَيْعُ ‏.‏ وَإِنْ تَفَرَّقَا بَعْدَ أَنْ تَبَايَعَا وَلَمْ يَتْرُكْ وَاحِدٌ مِنْهُمَا الْبَيْعَ فَقَدْ وَجَبَ الْبَيْعُ ‏" ‏ ‏.‏

sunnah.com