All praise is due to Allaah.
A marriage contract is valid in Islam if the following conditions are met, even if the marriage does not take place in a court, or in the presence of a Judge or the Imaam of the masjid. In addition, it does not need to be written.
The waliy (guardian) of the girl has accepted the proposal by saying, for example, "I marry you my daughter", and the one who proposed has replied, for example, by " I accept," or "I am satisfied" (i.e. with his acceptance).
This takes place in the presence of two male Muslim witnesses.
The woman is legally eligible to marry the man according to Islamic shari'ah (that is she is not a Mahram of the proposer [those to whom the proposer is forbidden to marry. etc.])
Note that Mahr (dowry given to the bride by the groom) is compulsory but can be paid before or anytime after the Nikaah according to the agreement between bride & groom!
Allah knows best.