It is narrated from Ata that a man asked Sayyiduna Ibn Abbas (may Allah be pleased with them both): "I hire myself out to these people and perform the rites of Hajj along with them; will I receive a reward for it?" He (may Allah be pleased with him) said: "Yes. 'Those will have a share of what they have earned.'"
Imam Musaddad recorded it, and the wording of Imam al-Bayhaqi's narration is that a man came to Sayyiduna Ibn Abbas (may Allah be pleased with them both) and said: "I hired myself out for Hajj and made it a condition with them that I would also perform Hajj; will this Hajj suffice for me?" He (may Allah be pleased with him) said: "You are among those about whom Allah Almighty said: 'Those will have a share of what they have earned, and Allah is swift in reckoning.'"
Hadith Gradingمحدثین:سكت عنه البوصيري، موقوف؛ إسناده صحيح
Hadith Takhrij«مسدد، عن يحيى القطان، عن ابن جريج، قال عطاء: سأل رجل ابن عباس (المطالب العالية 1149). رجاله أئمة ثقات، وقول ابن جريج «قال عطاء» محمول على السماع»