Abdullah bin Abbas reported,

The wife of Sinan bin Salama al-Juhani asked him to put a question to the Messenger of Allah ﷺ. Her mother had died without performing the Hajj, and she wanted to know whether it would suffice for her mother if she performed the Hajj on her behalf.He replied, "Yes. If her mother had a debt and she paid it off on her behalf, would it not be accepted from her? So let her perform the Hajj on behalf of her mother."

Azami 4763

Sahih

عن ابن عباس قال

أمرت امرأة سنان بن سلمة الجهني أن يسأل رسول الله ﷺ أن أمها ماتت ولم تحج أفيجزئ عن أمها أن تحج عنها؟ قال: نعم لو كان على أمها دين فقضته عنها ألم يكن يجزئ عنها؟ فلتحج عن أمها.

الأعظمي 4763صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Hajj
Chapter
Obligation of Hajj, its virtue, and its conditions
Section
Hajj on behalf of the deceased
Numbering
Jami al-Kamil 4763 (2nd edition)
Azami 4763