There may be two reasons for this.
1. A referral code has validity of 15 days so you may be using it after it's expiry date i.e. after 15 days
2. Code can be used only by 5 user i.e. before you 5 users have already used that to make purchase on our website.