API
Share with friends

Share with friends

To retrieve current's user unique referral link, you should perform following graphql query:

query($input: ShareLinkInputType) {
  shareLink(input: $input) {
    link
    earnedReward
    referralCode
    rewards {
      investmentAmount
      reward
    }
  }
}

with following payload:

{
  "input": {
    "platform": "RENTINVESTO" // or 'CROWDEX'
  }
}

Authorization: Bearer ACCESS_TOKEN

Response:

{
  "data": {
    "shareLink": {
      "link": "/refCode=D12C994B",
      "earnedReward": 0,
      "referralCode": "D12C994B",
      "rewards": [
        {
          "investmentAmount": 200,
          "reward": 10
        },
        {
          "investmentAmount": 500,
          "reward": 30
        },
        {
          "investmentAmount": 1000,
          "reward": 70
        },
        {
          "investmentAmount": 5000,
          "reward": 300
        }
      ]
    }
  }
}

Take into account that in order to get the full referral link, platform should have configured flag called BASE_URL with following format: FRONTEND_URL/refCode={{referralCode}}. {{referralCode}} is very important, as the user's individual code will be put there.