The Messenger of Allah ﷺ set out at the time of Hudaybiyyah, and the narrator mentioned the full account. Part of it includes the following.Suhayl bin Amr came and said, "Come, let us write a treaty between us and you."So the Prophet ﷺ called for the scribe, and the Prophet ﷺ said, "Write, In the name of Allah, the Most Gracious, the Most Merciful."Suhayl said, "As for 'the Most Gracious,' by Allah, I do not know what that is. Rather, write 'In Your name, O Allah,' as you used to write before."The Muslims said, "By Allah, we will only write it as 'In the name of Allah, the Most Gracious, the Most Merciful.'"The Prophet ﷺ said, "Write, In Your name, O Allah."
خرج رسول الله ﷺ زمن الحديبية، فذكر الحديث. وجاء فيه: فجاء سهيل بن عمرو، فقال: هات، اكتب بيننا وبينكم كتابا، فدعا النبي ﷺ الكاتب، فقال النبي ﷺ: بسم الله الرحمن الرحيم قال سهيل: أما الرحمن، فوالله ما أدري ما هي؟ ولكن اكتب باسمك اللهم، كما كنت تكتب، فقال المسلمون: والله لا نكتبها إلا بسم الله الرحمن الرحيم، فقال النبي ﷺ: اكتب باسمك اللهم.
Bukhari narrated it in the Book of Conditions (2731–2733) from Abdullah bin Muhammad, who said, Abdul-Razzaq narrated to us, Mamar informed us, who said, Zuhri informed me, who said, Urwa bin Zubayr informed me, from Miswar bin Makhrama and Marwan, who both related it at length.