Automation and tracking of offers and discounts

I would like some kind of automated way for any one of my members to have a promo code or offer linked directly to their account. If they can get someone to sign up on a one year plan I would give them some kind of portion of the subscription fee.

In a perfect world, the entire process is automated. Both the creation of promo links/codes that connect to a specific user and the issuing of credit on Stripe.

Is some or all of this possible?