It is now my understanding that the bonus comes off the lump sum that you have to pay your mortgage towards.
So if you buy a house for £200,000 and pay a £20,000 deposit then the bonus money (let's say it was £5,000) would come off the remaining £180,000 that you need to pay back. So you would only owe £175,000.
Does that make sense?