Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:11656

[Machine] That a man should give another man a garment and say, sell it to me for this and this amount. Whatever you add, it will be yours. And in what Abu Abdur-Rahman As-Sulami narrated to us, Abu Al-Hasan Al-Karizi informed us, Ali ibn Abdul Aziz narrated from Abu Ubaid, Hushaim narrated to us, Amr ibn Dinar reported from Ata, from Ibn Abbas about that. And this is also done by way of contentment, not by way of contract. And Allah knows best.  

البيهقي:١١٦٥٦وَكَانَ ابْنُ عَبَّاسٍ ؓ لَا يَرَى بَأْسًا

أَنْ يَدْفَعَ الرَّجُلَ إِلَى الرَّجُلِ الثَّوْبَ فَيَقُولُ بِعْهُ بِكَذَا وَكَذَا فَمَا زِدْتَ فَهُوَ لَكَ وَهُوَ فِيمَا أَخْبَرَنَا أَبُو عَبْدِ الرَّحْمَنِ السُّلَمِيُّ أنبأ أَبُو الْحَسَنِ الْكَارِزِيُّ ثنا عَلِيُّ بْنُ عَبْدِ الْعَزِيزِ عَنْ أَبِي عُبَيْدٍ ثنا هُشَيْمٌ حَدَّثَنَا عَمْرُو بْنُ دِينَارٍ عَنْ عَطَاءٍ عَنِ ابْنِ عَبَّاسٍ بِذَلِكَ وَهَذَا أَيْضًا يَكُونُ عَلَى سَبِيلِ الْمُرَاضَاةِ لَا عَلَى سَبِيلِ الْمُعَاقَدَةِ وَاللهُ أَعْلَمُ