From Sahih Bukhari (Hadith 3048):
Narrated Anas bin Malik:Some Ansari men asked permission from Allah's Messenger (ﷺ) saying, "O Allah's Messenger (ﷺ)! Allow us not to take the ransom of our nephew Al `Abbas. The Prophet (ﷺ) replied, "Do not leave a single Dirham thereof
Reference: Bukhari 3048