LOYALTY PROGRAMS API

InviteReferrals provides different API endpoints to fetch and send the data regarding the loyalty programs which are running on your sites. It tracks the data as soon as the users perform any action on the loyalty programs (earn or redeem loyalty points or any transaction takes place) and enable you to send and update data from our server to your server.

Below are the different APIs provided by the Invitereferrals :

  • Earn Points API.
  • Redeem Points API
  • Points Transaction API
  • Update Points API.

EARN LOYALTY API

This API enables you to send and update the data in InviteReferrals regarding the loyalty points earned by the users.

Call on the below API to send and update data for earning loyalty points

πŸ“˜

https://www.ref-r.com/loyalty/v1/earn/

πŸ“˜

You can get the activity id while creating an activity in the panel.

PARAMETERSTYPEDESCRIPTIONMANDATORY
Ip_namestringName of the user whose data is to be sent in InviteReferralsYes
Ip_emailstringEmail of the user whose data is to be sent in InviteReferralsYes
Ip_mobilestringMobile phone of the users whose data is to be sent in InviteReferralsYes
Ip_descriptionstringTransaction on which the user has earned pointsNo
Ip_orderidintegerOrder id of the userNo

PASS THE FOLLOWING VARIABLES AS PARAMETERS IN THE REQUEST BODY:

See the below examples

curl --request POST \
  --url https://www.ref-r.com/loyalty/v1/earn/<activity id>
  -- header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 84526BC18199D6785678' \
  --header 'x-brand-id:210'\{
"lp_name":"dhiraj",
"lp_email":"[email protected]",
"lp_mobile":"99182211",
"lp_description":"for purchase book",
"lp_orderid":"123456"
}

REDEEM LOYALTY API

This API enables you to send and update the data in InviteReferrals regarding the redeemed points earned by the users.

Call on the below API to send and update data for redeeming loyalty points

πŸ“˜

https://www.ref-r.com/loyalty/v1/redeem

PARAMETERSTYPEDESCRIPTIONMANDATORY
Ip_pointsIntegerData of the points redeemed by the users which is to be sent in InviteReferralsYes
Ip_mobile/Ip_email idstringMobile number of the user/email Id of the usersYes

PASS THE FOLLOWING VARIABLES AS PARAMETERS IN THE REQUEST BODY

See the below example :

curl --request POST \
  --url https://www.ref-r.com/loyalty/v1/redeem
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 84526BC18199DF7580D6785678'' \
  --header 'x-brand-id:210'\
{
"lp_points":100,
"lp_mobile": "991822211"
}

LOYALTY TRANSACTION API

This API enables you to fetch the data from InviteReferrals to your server regarding the actions performed or transactions occurring in a loyalty program.

Call on the below API to send and update data for loyalty programs transactions

πŸ“˜

https://www.ref-r.com/loyalty/v1/transaction

PARAMETERSTYPEDESCRIPTIONMANDATORY
Ip_email/lp_mobilestringIf your primary user identifier is email id then you have to use lp_email, if your primary user identifier is mobile then you have to use lp_email, of the user whose data you need to fetch from InviteReferralsYes
Ip_typestringEarned and redeemed points data of the user which you need to fetch from InviteReferrals. Please find posssible values of lp_type -
1. earn - get only points earned history.
2. redeem - get only redeemed points history.
3. all - get earned and redeemed history in diff parameters.
4. ledger - get combined history of earned and redeemed points.
Yes

PASS THE FOLLOWING VARIABLES AS PARAMETERS IN THE REQUEST BODY

curl --request POST \
  --url https://www.ref-r.com/loyalty/v1/transaction
  -- header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 84526BC181XXXXXXXX6' \
  --header 'x-brand-id:2XX0'\{
   {
"lp_email":"[email protected]"
}

UPDATE POINTS API

This API enables you to send and update the data in InviteReferrals regarding the updated points by the users on a loyalty program.

Call on the below API to send and update data for updated points in the loyalty program

πŸ“˜

https://www.ref-r.com/loyalty/v1/updatePoints

PARAMETERSTYPEDESCRIPTIONMANDATORY
Ip_statusStringTo cancel or approve the processing of earning points via API. Possible lp_status value is
1. approve
2. cancel
Yes
Ip_orderidintegerOrder id of the user whose data is to be sent in InviteReferralsYes

PASS THE FOLLOWING VARIABLES AS PARAMETERS IN THE REQUEST BODY

curl --request POST \
  --url https://www.ref-r.com/loyalty/v1/updatePoints
  -- header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 84526BC18199DF7580DEBF16785679D' \
  --header 'x-brand-id:210'\{
{
"lp_status":"approve",
"lp_orderid": "1qazv"
}