PowerlineApp / powerline-mobile

Other
4 stars 16 forks source link

Referral Discount Code Strategy #498

Open jterps08 opened 7 years ago

jterps08 commented 7 years ago

Migrating over from server repo...

The ability to auto-create a unique ‘referral’ code for every new user A that can be used by other users B C D etc to discount their group subscriptions Groups X Y Z etc. A user's own referral code cannot be used on their own groups. For every 3 successful referrals, the user earns a single 3 month 100% off discount.

When entering the discount/referral code during group subscription purchase, the system checks the code against the referral code tracking table first to find the actual Stripe discount code stored in the table. If there is no referral code in the table, the user-entered code is sent to Stripe as a discount code, which may or may not be processed successfully…

Story

  1. User A registers on system
  2. System assigned User A unique referral code ABCDEFG1234
  3. System links User A referral code ABCDEFG1234 to Stripe Discount Code 1STMONTH. End users never sees Stripe Discount Code 1STMONTH.
  4. User A can see and share his own referral code (ABCDEFG1234) to User B, User C, and User D.
  5. User A shares referral code ABCDEFG1234 to new User B. (User B has his own referral code, BCDEFG12345, but cannot use his own referral code on his own groups)
  6. User B uses referral/discount code from user A (ABCDEFG1234) to register one or more new group eg SaveThePlanet
  7. System compares provided discount code (ABCDEFG1234) against the providing user’s identity (e.g. User B has BCDEFG12345... ABCDEFG1234 does not equal BCDEFG12345) to ensure that the person is not using his own code. System allows User B to use ABCDEFG1234 to discount a group subscription, but does not allow User A to use ABCDEFG1234 to discount his own group subscription. System does not allow User B to use his own code BCDEFG12345 to discount any group subscription for a group he creates.
  8. System tracks the fact that User A’s referral code (ABCDEFG1234) was used by User B once.
  9. System tracks the fact that User A’s referral code (ABCDEFG1234) was used by User C twice.
  10. System tracks the fact that User A’s referral code (ABCDEFG1234) was used by User D once.
  11. System tracks the fact that User A’s referral code (ABCDEFG1234) was used by User B 1x, User C 2x, and User D 1x – the code was used 4 times.
  12. For every third successful referrals, the system provides User A with a Reward Code via e-mail. So, the system e-mails User A with a Reward Code on the 3rd referral, the sixth referral, and so on. The Reward code is system-generated and also links back to a Stripe Discount code.

For example, User A’s referral code (ABCDEFG1234) is used successfully by 4 different paying groups. System calculates that User A has >3 successful referrals. The system e-mails a 3 month free discount code to User A. System rewards User A with unique Reward Code (XYZ5678) which can be used by User A on his own group(s)

All referral codes link back to the same Stripe Discount code. (e.g. 1STMONTH) All reward codes link back to unique Stripe Discount code (e.g. REWARD3M)

This is all essentially seven distinct steps:

  1. An auto-generated unique alphanumeric referral code for every user
  2. A table that links user's unique referral codes to common/shared Stripe Discount code (I will provide via Slack)
  3. A field that allows a user to enter a referral code or discount code when setting up a group subscription (Stripe coupon when creating a new customer / adding payment card)
  4. An updated endpoint that provides the user's own referral code
  5. A connection to Stripe to create a 3-month free discount code Gold tier one-time use (reward code)... https://stripe.com/docs/api#create_coupon
  6. An automated e-mail that sends out the one-time use reward code to the user
  7. +25 points for each referral that is used by another user (i.e. Steps 8-
igaponov commented 7 years ago

@jterps08 I need a subject/text for an email about referral code and reward code.

jterps08 commented 7 years ago

Subject "You've earned a Powerline Reward!" Text "Thanks for being a champion of democracy and community engagement. Your referral code has been used three times, which means you've just earned your own reward code [reward code]. You can apply this code by going to your Group Profile, Click "Manage Group", and tap on the Subscription Level (e.g. Silver) you would like to use it on. It's worth 3 free months of Powerline service! Leaders help create more leaders, and we're thrilled that you've been helping to create more Powerline leaders. Keep sharing your referral code and earn more free subscriptions! Thank you!"

We will probably update the text later but this is fine for now.

igaponov commented 7 years ago

@jterps08 I guess a text for referral code should be different, can you please provide it too?

jterps08 commented 7 years ago

I imagine referral code being provided to frontend and we'll surround it with text there. Are we in alignment? @igaponov

igaponov commented 7 years ago

@jterps08 ok

igaponov commented 7 years ago

@jterps08 can a user has only one referral code?

jterps08 commented 7 years ago

Correct. It's their own unique referral code that they can pass to friends

igaponov commented 7 years ago

https://api-dev.powerli.ne/api-doc#get--api-v2-user-discount-code

jterps08 commented 7 years ago

@igaponov We need a place to provide this Referral Discount code for a user when they are changing their group subscription. It looks like we can provide this when the user selects a plan / subscription.

User Stamos owns group buildtest1088. He is currently on Silver subscription. He wants to upgrade to Gold subscription and enter his referral code for the discount.

The app should be able to accept referral code when user selects any silver/gold/platinum subscription level. The system should look up that referral code and pass the appropriate discount code to Stripe as a coupon when changing the subscription plan. I think this will need to be handled as part of the frontend work but it may require some backend work, too:

User needs ability to identify their own referral code (backend work done; frontend work not done) User needs ability to provide someone else's referral code during subscription plan selection (backend work ? ; frontend work not done)

The error that the user currently experiences when trying to change subscription plans is: screenshot_20170330-131153