Imam ibn Taymiyyah (D. 728 A.H) said :
قال شيخ الإسلام ابن تيمية رحمه الله :
لو شرط أحد الزوجين في الآخر صفةً مقصودة ، كالمال ، والجمال ، والبكارة ، ونحو ذلك : صح ذلك ، وملك المشترِط الفسخ عند فواته في أصح الروايتين عن أحمد ، وأصح وجهي الشافعي ، وظاهر مذهب مالك ، والرواية الأخرى : لا يملك الفسخ إلا في شرط الحرية والدِّين .
If among the husband or wife , either of them wishes to keep certain conditions before marrying that their partner should be/have such and such traits for example beauty, virgin (being young; being wealthy ) etc. then this is right . As per one authentic transmission from Imam Ahmad and from Imam Shaf`ee and also from the apparent Madhab of Imam Malik , the one who places the condition upon being deceived has the right to annul the marriage
[Ref: Majmoo` al-Fatawa 29/175]
The scholars have also said that :
إذا اشترط الزوج أن تكون الزوجة بكراً وبانت بخلاف ذلك فله الحق في فسخ العقد ، فإن كان ذلك قبل الدخول فلا شيء لها من المهر ، وإن كان بعد الدخول ، فإن كانت هي التي خدعته ردَّت إليه المهر ، وإن كان الذي خدعه هو وليها أو غيره دفع المهر للزوج .
When the husband prior to marriage placed a condition that the woman (he is going to marry) be a virgin (i.e. not of bad character who indulges with multiple men before marriage as is the norm for the western women today) but he finds out that she happens to be opposite of what he had requested then he has the right to annul the marriage contract . If (he finds out before) intercourse and rukhsati takes place then she will not receive any mehar (dowry amount paid by the husband) but if he finds out after consummating the marriage then if the wife was the one to deceive then she will return the mehar amount to her husband and if her guardians were the ones to deceive then they will return the mehar amount to the husband
Also see the article :