Is it permissible to stipulate another contract within the loan contract?
Chapter on Loan (Qard)
Al-Mughni
Book of Sales
Primary text
It is not permissible to stipulate within the loan contract that the borrower must rent his house to the lender, sell something to the lender, or that the borrower must provide another loan in the future. This is forbidden because the Prophet (peace be upon him) forbade the combination of sale and loan (Bay' wa Salaf). Furthermore, stipulating one contract within another contract is invalid, analogous to one selling his house on the condition that the buyer sells his house back. Stipulating that the borrower rents the lender's property for less than its rent, or rents the lender's property for more than its worth, or stipulates a gift or service, is an even more severe prohibition.
Supporting text
If a gift or service is rendered after the fulfillment of the loan without prior stipulation, it should generally not be accepted unless it is reciprocated or counted against the original debt. An exception exists if such giving was customary between them prior to the loan.