Referrals
Referral system management
Generate referral invitation
POST/rest_api/v2/referrals/invitations
Create a new referral invitation link for a customer
Authorizations
X-Joy-Loyalty-App-KeystringRequired
X-Joy-Loyalty-Secret-KeystringRequired
Request body
emailstring · emailRequired
Responses
200Invitation generated successfully
successbooleanOptional
Example:
truedataobjectOptional
Show properties
inviteLinkstringOptional
referralCodestringOptional
metaobjectOptional
Additional metadata such as counts and pagination
messagestringOptional
Example:
"Operation completed successfully"timestampstring · date-timeOptional
Example:
"2023-07-28T07:27:54.123Z"POST/rest_api/v2/referrals/invitations
POST /rest_api/v2/referrals/invitations HTTP/1.1Host: dev-api.joy.soX-Joy-Loyalty-App-Key: YOUR_API_KEYX-Joy-Loyalty-Secret-Key: YOUR_API_KEYContent-Type: application/jsonAccept: */*Content-Length: 33{"email": "[email protected]"}
200Invitation generated successfully
{"success": true,"data": {"inviteLink": "string","referralCode": "string"},"meta": {},"message": "Operation completed successfully","timestamp": "2023-07-28T07:27:54.123Z"}
Get customer referrers
GET/rest_api/v2/referrals/customers/{customerId}/referrers
Retrieve list of customers who referred this customer
Authorizations
X-Joy-Loyalty-App-KeystringRequired
X-Joy-Loyalty-Secret-KeystringRequired
Parameters
customerIdpath · stringRequired
Customer ID
Responses
200List of referrers
successbooleanOptional
Example:
truedataobject[]Optional
metaobjectOptional
Show properties
countintegerOptional
Number of items returned
messagestringOptional
Example:
"Operation completed successfully"timestampstring · date-timeOptional
Example:
"2023-07-28T07:27:54.123Z"GET/rest_api/v2/referrals/customers/{customerId}/referrers
GET /rest_api/v2/referrals/customers/{customerId}/referrers HTTP/1.1Host: dev-api.joy.soX-Joy-Loyalty-App-Key: YOUR_API_KEYX-Joy-Loyalty-Secret-Key: YOUR_API_KEYAccept: */*
200List of referrers
{"success": true,"data": [{}],"meta": {"count": 1},"message": "Operation completed successfully","timestamp": "2023-07-28T07:27:54.123Z"}
Get customer referral summary
GET/rest_api/v2/referrals/customers/{customerId}/summary
Retrieve comprehensive referral statistics for a customer
Authorizations
X-Joy-Loyalty-App-KeystringRequired
X-Joy-Loyalty-Secret-KeystringRequired
Parameters
customerIdpath · stringRequired
Customer ID
Responses
200Referral summary
successbooleanOptional
Example:
truedataobjectOptional
Show properties
totalRedeemCouponintegerOptional
totalPointEarnReferintegerOptional
metaobjectOptional
Additional metadata such as counts and pagination
messagestringOptional
Example:
"Operation completed successfully"timestampstring · date-timeOptional
Example:
"2023-07-28T07:27:54.123Z"GET/rest_api/v2/referrals/customers/{customerId}/summary
GET /rest_api/v2/referrals/customers/{customerId}/summary HTTP/1.1Host: dev-api.joy.soX-Joy-Loyalty-App-Key: YOUR_API_KEYX-Joy-Loyalty-Secret-Key: YOUR_API_KEYAccept: */*
200Referral summary
{"success": true,"data": {"totalRedeemCoupon": 1,"totalPointEarnRefer": 1},"meta": {},"message": "Operation completed successfully","timestamp": "2023-07-28T07:27:54.123Z"}
Get referral analytics
GET/rest_api/v2/referrals/analytics
Retrieve referral program analytics and performance metrics
Authorizations
X-Joy-Loyalty-App-KeystringRequired
X-Joy-Loyalty-Secret-KeystringRequired
Parameters
startDatequery · string · dateOptional
endDatequery · string · dateOptional
Responses
200Referral analytics data
successbooleanOptional
Example:
truedataobjectOptional
Show properties
countCouponCodeUsageintegerOptional
metaobjectOptional
Additional metadata such as counts and pagination
messagestringOptional
Example:
"Operation completed successfully"timestampstring · date-timeOptional
Example:
"2023-07-28T07:27:54.123Z"GET/rest_api/v2/referrals/analytics
GET /rest_api/v2/referrals/analytics HTTP/1.1Host: dev-api.joy.soX-Joy-Loyalty-App-Key: YOUR_API_KEYX-Joy-Loyalty-Secret-Key: YOUR_API_KEYAccept: */*
200Referral analytics data
{"success": true,"data": {"countCouponCodeUsage": 1},"meta": {},"message": "Operation completed successfully","timestamp": "2023-07-28T07:27:54.123Z"}