It is narrated from Ibn Umar (may Allah be pleased with them both) that he said: Umar (may Allah be pleased with him) came to the Prophet (ﷺ) and said: O Messenger of Allah! I have acquired such wealth that I have never acquired better wealth than this before, and I intend to seek nearness to Allah through it. So the Messenger of Allah (ﷺ) said: "Keep its original property with yourself, and give its fruits in charity in the way of Allah."
Hadith Referenceمسند الإمام الشافعي / كتاب الوقف والعمرى والرقبى / 1063