How does VAT work in the case of referral fees?

Say for example I made an arrangement where I paid a referral fee for every customer that...