Al-Ilmam bi-Ahadith al-Ahkam 1017
وَعَن عَمْرو بن شُعَيْب، عَن أَبِيه، عَن جده، عَن النَّبِي ﷺ قَالَ: " إِذا تزوج أحدكُم امْرَأَة اَوْ اشْتَرَى خَادِمًا فَلْيقل: اللَّهُمَّ إِنِّي أَسأَلك خَيرهَا وَخير مَا جبلتها عَلَيْهِ، وَأَعُوذ بك من شَرها ﷺ وَشر مَا جبلتها عَلَيْهِ، وَإِذا اشْتَرَى بَعِيرًا فليأخذ بِذرْوَةِ (سنامه) وَليقل مثل ذَلِك ". وَفِي رِوَايَة: " ثمَّ ليَأْخُذ بناصيتها، وليدع بِالْبركَةِ فِي الْمَرْأَة، وَالْخَادِم ". أخرجه أَبُو دَاوُد.
And from ʿAmr ibn Shuʿayb, from his father, from his grandfather, from the Prophet ﷺ, who said: "When one of you marries a woman or buys a servant, let him say: O Allah, I ask You for her good and the good of the nature You have given her, and I seek refuge in You from her evil and the evil of the nature You have given her. And when he buys a camel, let him take hold of the top of its (hump) and say the like of that." In one narration: "Then let him take hold of her forelock and pray for blessing in the woman and the servant." Abu Dawud recorded it.