If this is towards the deposit, the lender will insist that it’s either the gift or that it’s not repayable during the term of the mortgage. That’s because they will not allow further borrowing which may prevent them paying the main mortgage.
You are going to have to have a solicitor anyway to deal with the purchase so you might as well get the solicitor to deal with this. You certainly need a loan agreement to lay down the terms of the lending and the payback.
A basic loan agreement should be sufficient to be frank. I have probably got one somewhere that you could use by filling in the blanks. I will have a look and I have, I will submit premium services proposal for you. It’s optional extra.
Ideally, to protect your friend, there should be a legal charge registered at the land registry. However some mortgage lenders will not allow that. It does protect your friend, not you.
Thank you for letting me assist you with your legal question. I am glad that I was able to help.
I am not certain whether that answers the question for you or not, but I am happy to answer any specific points arising from this.
It will be my pleasure to help you again either further with this or any future questions you have