Sunan Ibn Majah, Book 25, Hadith 3017 (In-Book) ⓘ
It was narrated from Abu Ghawth bin Husain – a man from Furu’ – that he consulted the Prophet about a Hajj that his father owed, but he had died and had not gone for Hajj. The Prophet said: “Perform Hajj on behalf of your father.” And the Prophet said: “The same applies to fasting in fulfillment of a vow – it should be made up for.”
حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ، حَدَّثَنَا الْوَلِيدُ بْنُ مُسْلِمٍ، حَدَّثَنَا عُثْمَانُ بْنُ عَطَاءٍ، عَنْ أَبِيهِ، عَنْ أَبِي الْغَوْثِ بْنِ حُصَيْنٍ، - رَجُلٌ مِنَ الْفُرْعِ - أَنَّهُ اسْتَفْتَى النَّبِيَّ ـ صلى الله عليه وسلم ـ عَنْ حِجَّةٍ كَانَتْ عَلَى أَبِيهِ مَاتَ وَلَمْ يَحُجَّ قَالَ النَّبِيُّ ـ صلى الله عليه وسلم ـ " حُجَّ عَنْ أَبِيكَ " . وَقَالَ النَّبِيُّ ـ صلى الله عليه وسلم ـ " وَكَذَلِكَ الصِّيَامُ فِي النَّذْرِ يُقْضَى عَنْهُ " .
also referenced under: Hadith 2905 (Reference) & Volume 4, Book 25, Hadith 2905 (DarusSalam)