Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:215

They ask you, ˹O Muhammad˺, what they should spend. Say, "Whatever you spend of good is ˹to be˺ for parents and relatives and orphans and the needy and the traveler. And whatever you do of good - indeed, Allah is Knowing of it."  

They will ask you, O Muhammad (s), about what they should expend. This was the question posed by ‘Amr b. al-Jamūh. He was a wealthy elderly man and went to ask the Prophet (s) what and for whom he should expend; Say, to them: ‘Whatever you expend of good (min khayrin, ‘of good’, is an explication of mā, ‘whatever’, covering small and large amounts, and denotes one half of the question represented by the expender; God responds with regard to the one receiving the expenditure, this pertaining to the other half of the question, in the following) it is for parents and kinsmen, orphans, the needy, and the traveller, that is, they are the most deserving of it; and whatever good you may do, by way of expending or otherwise, God has knowledge of it’, and will requite it accordingly.
القرآن:٢:٢١٥

يَسْأَلُونَكَ مَاذَا يُنْفِقُونَ ۖ قُلْ مَا أَنْفَقْتُمْ مِنْ خَيْرٍ فَلِلْوَالِدَيْنِ وَالْأَقْرَبِينَ وَالْيَتَامَىٰ وَالْمَسَاكِينِ وَابْنِ السَّبِيلِ ۗ وَمَا تَفْعَلُوا مِنْ خَيْرٍ فَإِنَّ اللَّهَ بِهِ عَلِيمٌ  

{يسألونك} يا محمد {ماذا ينفقون} أي الذي ينفقونه والسائل عمرو بن الجموح وكان شيخاً ذا مال فسأل النبي ﷺ عما ينفق وعلى من ينفق {قل} لهم {ما أنفقتم من خير} بيان لما شامل للقليل والكثير وفيه بيان المنفق الذي هو أحد شقي السؤال وأجاب عن المصرف الذي هو الشق الآخر بقوله: {فللوالدين والأقربين واليتامى والمساكين وابن السبيل} أي هم أولى به {وما تفعلوا من خير} إنفاق أو غيره {فإن الله به عليم} فمجاز عليه.