بسم الله الرحمن الرحيم
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 Uloom Deoband
This answer was collected from the official ifta website of Darul Uloom Deoband in India.