Question: It is said that the prevailing ʿurf (custom) is acted upon in the Sharīʿah so long as it does not contradict a text; meaning that the judge rules in accordance with it, and it is said regarding it that it is the ruling of Allah. What is the evidence for that?
It may be said in answer: The prevailing customary practice among the people of that custom is tantamount to their consent to it and their commitment to it; and there is no doubt that a person is held to what he has bound himself to and consented to. The ruling from Allah the Exalted upon the legally responsible (mukallafīn) by what they have accepted and committed themselves to has been established by His saying: “But man, against himself, will be a witness.” [al-Qiyāmah:14] And His saying: “Except that it be trade conducted by mutual consent.” [al-Nisāʾ:29] And His saying: “Fulfil the contracts.” [al-Māʾidah:1] And His saying: “They fulfil their vows.” [al-Insān:7] And His saying: “And among them are those who made a covenant with Allah saying : ‘If He gives us out of His bounty…’ ” [al-Tawbah:75] And the like of: “…and when he breaks his promise…”. Thus, there is no objection to stating that the ruling which results from customary practice (ʿurf) is a ruling of Allah the Exalted.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2