Hi @edwintamarez :)
I have also followed you up, wish you success.
Thank you for leaving the question. I'm afraid your question will be difficult for me to explain. You know, if you have a little understanding of "programming languages" this would be simple for you to implement.
Here are two examples of creating and recording the resulting referral code. You can look through them :)
https://developers.friendbuy.com/#introduction
https://github.com/kinduff/spree_reffiliate