What is the ruling on paying a fee to a brokerage in order to obtain a loan or purchase real estate through the bank?
Question

Is it permissible to pay a fee to a brokerage company for the purpose of obtaining a loan or purchasing real estate through an Islamic bank? Please note that the amount that the brokerage company charges is a percentage of the value of the loan or property that they help me to obtain. May Allah reward you with good.
Praise be to Allah.Firstly:
Ruling on brokerage for the purpose of obtaining loans
It is permissible to act as a broker or mediate to obtain a goodly [i.e., interest-free] loan, or to buy property through a bank, if the purchase is subject to shar‘i regulations.
It is not permissible to act as a broker or mediate to obtain a riba-based loan or purchase real estate through unlawful means, because of what that involves of cooperating in sin.
Secondly:
Types of brokerage for loans
The brokerage company may work in obtaining loans or purchasing real estate. Its work may involve merely telling the client about a lender or a seller; or its work may involve using its position and interceding (putting in a good word for the client); or it may do that in return for guaranteeing the borrower or purchaser. Hence there are three scenarios:
1.. If the role of the brokerage company is simply telling someone about a lender or seller (and putting them in touch with one another), this is a kind of brokerage that is permissible, and it is permissible for the fee to be a set amount or a percentage of the loan or of the price of the property, according to the more correct scholarly view.
2.. If the brokerage company is mediating on the basis of its status and renown and interceding (putting in a good word for the client), then in this case, with regard to charging a fee for that there is a difference of scholarly opinion. The view that is more likely to be correct is that this is permissible. This is the view of the Shaafa‘is and Hanbalis, and some of the Maalikis.
It says in Mughni al-Muhtaaj (Shaafa‘i), 3/35: al-Maawardi said: If he says to someone else: Get me a loan of one hundred and I will give you ten, then that is a fee. End quote.
It says in ar-Rawd al-Murbi‘ (Hanbali), in the chapter on loans: If he says: Get me a loan of one hundred, and you will have ten, that is valid, because it is in return for using his renown or status. End quote.
It says in al-Insaaf (5/134): If he pays him a fee in return for getting him a loan on the basis of his renown and position, that is valid, because it is in return for using his position and renown only. End quote.
3.. If the company will guarantee the borrower or purchaser, then it is not permissible for it to charge a fee in return for guaranteeing him, because giving a guarantee is a voluntary commitment (of a charitable nature) and it is not permissible to take something in return for doing that.
Ibn al-Mundhir (may Allah have mercy on him) said: All the scholars from whom we acquired knowledge are agreed that guaranteeing in return for a fee paid to the one making the guarantee is not permissible and is not allowed.
End quote from al-Ishraaf ‘ala Madhaahib Ahl al-‘Ilm (6/230).
Ibn Jareer at-Tabari said in Ikhtilaaf al-Fuqaha’ (p. 9): If a man gives a guarantee for another man who owes something to a third man in return for a fee from the one who is the subject of the guarantee, then that is invalid. End quote.
In al-Ma‘aayeer ash-Shar‘iyyah (p. 251) it says: The four madhhabs are agreed that it is not allowed to pay a fee for a guarantee. The Islamic Fiqh Council issued a statement to that effect. End quote.
And Allah knows best.