SaaSquatch Help Center

Follow this guide to setup a "Give 1 Month, Get 1 Month Referral Program" using the SaaSquatch REST API and Squatch.js

Install squatch.js
squatch.js will show a gorgeously rendered popup in your app so your customers can seamlessly refer their friends.
Track Conversions
When a referred user converts, typically to paid, notify Referral SaaSquatch so their rewards can be distributed.
Redeem Time
When someone wants to redeem their Free Time, adjust their Free Time balance and give them their reward.


How to use the REST API to track conversions

Step 1 - Notify SaaSquatch of the new account status

If this is the first purchase that a customer has made, use this API call to notify SaaSquatch about the new account status. In particular, make sure to set status: PAID. You should update this status for all accounts. If a valid referral has been made, and someone has paid their first bill, then SaaSquatch will automatically add Free Time to the account of the friend that referred them.


Example Request Example Response
$ curl https://app.referralsaasquatch.com/api/v1/TENANT_ALIAS/accountsync \
-u API_KEY: \
-H "Content-Type: application/json" \
-d '{ "id": "SV0TYE5OWI11120144",
  "currency": "USD",
  "subscription": {
    "status": "PAID", 
    "value": 99.99,
    "billingIntervalType": "DAY",
    "billingIntervalValue": 30
  }
}'
{
  "id": "SV0TYE5OWI11120144",
  "currency": "USD",
  "subscription": {
    "status": "PAID", 
    "value"": 99.99,
    "billingIntervalType": "DAY",
    "billingIntervalValue": 30
  },
  "referral": {
    "code": "BOBTESTERSON"
  }
}

How to redeem Free Time

Step 1 - Lookup Free Time balance

Lookup a users' Free Time balance by checking the balance of an account. This will include both Free Time from being referred and referring others. It is possible to explore the individual Free Time Rewards that has been earned by an account (see List Rewards), but for most cases it is simpler to just lookup the full reward balance.

Looking up the Free Time Reward balance does not change the state of an account, so you can also use this call to display a users' Free Time balance on any page. For example, using the example response below, you could include a message in your app head "You've earned 1 Free Month. Make more referrals to earn more."


Example Request Example Response
$ curl https://app.referralsaasquatch.com/api/v1/{TENANT_ALIAS}/reward/balance?accountId=SV0TYE5OWI11120144 \
-u API_KEY: \
-H "Content-Type: application/json"
[
    {
        "type": "CREDIT",
        "count": 1,
        "totalAssignedCredit":1,
        "totalRedeemedCredit" : 0,
        "unit": "months"
    }
]
Step 2 - Fulfill Reward

You are responsible for fulfilling the rewards for your users.

Step 3 - Redeem Free Time with Referral SaaSquatch

Update the accounts' balance in SaaSquatch once Free Time have been used. This lets SaaSquatch display a users' up-to-date Free Time balance and lets us track Free Time usage. Use the Debit Account Balance endpoint to mark the Free Time as used.


Example Request Example Response
$ curl https://app.referralsaasquatch.com/api/v1/TENANT_ALIAS/credit/bulkredeem \
-u API_KEY: \
-H "Content-Type: application/json" \
-d '{
    "accountId" : "SV0TYE5OWI11120144",
    "amount" : 1, 
    "unit" : "months"
}'
{
    "creditRedeemed": 1,
    "creditAvailable": 0,
    "unit": "months"
}