Strange.... It worked perfectly every time for me. Check if the link is correct, then see if the referral code matches. If it's all good, then try it out again.

Is that I do not get to that part, just click on invite friends says failed. I do not know if it has to do with the country and the ip

It shouldn't be restricted by country. Try it manually. Let your friend know where to download the app and manually input your ref code and it should work fine.