بسم الله الرحمن الرحيم
(Fatwa: 782/742/SD=8/1438)
None is the owner of human corpse. Hence it is unlawful and haram to sell and purchase it. Thus, the amount, mentioned there in the question, shall not be lawful for you to use. You should return the amount to the purchaser and take back the corpse and then return it to the person whom you bought it and take back your money. If it is not possible, then surrender the corpse to the heirs, and if you don’t know them then bury it.
Allah knows Best!
Darul Ifta,
Darul Uloom Deoband