Skip to content

krishna-mathuria/referral_flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Referral System

A Referral System where users can register with someone's referral code to receive incentives. Incentives would be divided between the referrer and referee according to the referral code provided. Additional features include history of referral, obtaining referral codes etc. Project is built using Django Rest Framework and APIs can be accessed through either browsable api link or postman.

Database Structure

Screenshot (33)

NOTES:

  • Share is the way in which the user wants to divide each referral incentive. (Eg: If the share value of User A is 15 then whenever a new user B uses A’s referral code, 15 out of 20 incentive credits would be given to A and 5(20-15) to B.
  • Username of the user is their email address.
  • Referred By in User is the referral code of the referrer.

Some Basic Endpoints:

  • Login:

    • Url : /auth/token/login
    • Request: POST
    • Body: {“username” , “password” }
  • Sign-Up:

    • Url: /auth/users/
    • Request: POST
    • Body: Required -> {“username”,”first_name”,”last_name”,”password”}
    • Body: Additional -> {“share”,”referred_by_code”}
  • Get Referral Code:

    • Url: /api/mycode
    • Request: GET
    • Headers: 'Authorization: Token < enter token here >'
  • Referral History:

    • Url: /api/referralhistory
    • Request: GET
    • Headers: 'Authorization: Token < enter token here >'
  • User Details:

    • Url: /auth/users/me
    • Request: GET
    • Headers: 'Authorization: Token < enter token here >'

Few Example APIs:

Sign Up:

Screenshot (30)

Get Referral Code:

Screenshot (31)

Referral History:

Screenshot (32)

Some Additional Features that could be implemented in future:

  • Custom editable referral codes.
  • Swagger for API documentation.
  • Direct Referral Links.
  • Multiple Referral Codes with different share values.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages