Abdullah bin Amr reported that the Prophet ﷺ said, "When one of you marries a woman or purchases a servant, let him say, 'O Allah, I ask You for her goodness and the goodness of the nature with which You have created her, and I seek refuge in You from her evil and the evil of the nature with which You have created her.' And when one of you buys a camel, let him take hold of the top of its hump and say the same."In another wording, "When one of you acquires a wife, a servant, or a riding animal, let him take hold of its forelock and say," and he then mentioned the supplication.
عبد الله بن عمرو، عن النبي ﷺ قال: إذا تزوج أحدكم امرأة، أو اشترى خادما فليقل: اللهم إني أسألك خيرها، وخير ما جبلتها عليه، وأعوذ بك من شرها ومن شر ما جبلتها عليه، وإذا اشترى بعيرا فليأخذ بذروة سنامه وليقل مثل ذلك. وفي لفظ: إذا أفاد أحدكم امرأة، أو خادما، أو دابة، فليأخذ بناصيتها، وليقل: فذكر الحديث.
Reported by Abu Dawud (2160), Ibn Majah (1918), Ibn Sunni in Amal al-Yawm wal-Layla (100), Hakim (2/185), and Bayhaqi (7/148), all of them from the hadith of Muhammad bin Ajlan, from Amr bin Shuayb, with his chain of transmission, similarly. Its chain is hasan because of Muhammad bin Ajlan and Amr bin Shuayb, for both of them make the hadith hasan.