It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him) shaved his head, and the Messenger of Allah (peace and blessings be upon him) ordered him to give a ransom (fidyah), so he gave a cow as ransom.
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16260