Ibn Ishaq narrates regarding the story of Qurayzah that the Messenger of Allah (peace and blessings be upon him) sent Sayyiduna Sa'd bin Zayd (may Allah be pleased with him), the brother of Banu Abd al-Ashhal, with the captives of Banu Qurayzah towards Najd, (saying): "Buy horses and weapons in exchange for them."
Imam al-Shafi'i (may Allah have mercy on him) said: Likewise adult women: the Messenger of Allah (peace and blessings be upon him) asked his Companions to give him an adult slave girl, and he ransomed two men with her.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18329