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
You can get the activity id while creating an activity in the panel.
PARAMETERS | TYPE | DESCRIPTION | MANDATORY |
---|---|---|---|
Ip_name | string | Name of the user whose data is to be sent in InviteReferrals | Yes |
Ip_email | string | Email of the user whose data is to be sent in InviteReferrals | Yes |
Ip_mobile | string | Mobile phone of the users whose data is to be sent in InviteReferrals | Yes |
Ip_description | string | Transaction on which the user has earned points | No |
Ip_orderid | integer | Order id of the user | No |
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
PARAMETERS | TYPE | DESCRIPTION | MANDATORY |
---|---|---|---|
Ip_points | Integer | Data of the points redeemed by the users which is to be sent in InviteReferrals | Yes |
Ip_mobile/Ip_email id | string | Mobile number of the user/email Id of the users | Yes |
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
PARAMETERS | TYPE | DESCRIPTION | MANDATORY |
---|---|---|---|
Ip_email/lp_mobile | string | If 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 InviteReferrals | Yes |
Ip_type | string | Earned 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
PARAMETERS | TYPE | DESCRIPTION | MANDATORY |
---|---|---|---|
Ip_status | String | To cancel or approve the processing of earning points via API. Possible lp_status value is 1. approve 2. cancel | Yes |
Ip_orderid | integer | Order id of the user whose data is to be sent in InviteReferrals | Yes |
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"
}