Many merchants let customers share a referral code or link with friends.
To detect self-referral, Ravelin needs to know who owns each referral code. When a customer enters a referral code, we check how closely they are connected to the owner of the code in the Connect network. A customer who shares a device or other attributes with the owner of the code is likely to be referring themselves.
When a customer creates a referral code, send it to our Voucher endpoint.
Since you are not requesting a recommendation, you do not need to add the score query parameter to the URL.
Send the customer who owns the code in the customer object. In the voucher object, set voucherType to REFERRAL and referrerId to the owner’s customerId.
You only need to send referrerId when registering the voucher. You do not need to send it again in Voucher Assessment requests or voucher redemptions.
When another customer uses the code, continue to set voucherType to REFERRAL in the Voucher Assessment request and voucher redemption.
If you use referral links, send the code contained in the link as voucherCode. Use the same voucherCode when the link is used.
An example request is shown below:
POST https://api.ravelin.com/v3/voucher HTTP/1.1
Authorization: token ...
Content-Type: application/json
{
"timestamp": 1512828988826,
"customer": {
"customerId": "customer-123",
"email": "jsmith123@example.com"
},
"voucher": {
"voucherCode": "REFER20",
"valueType": "PERCENTAGE",
"percentage": 20,
"maxDiscountValue": 1500,
"currency": "GBP",
"referrerId" : "customer-123",
"voucherType": "REFERRAL"
},
"device": {
"deviceId": "device-123",
"ipAddress": "81.152.92.84"
}
}An example response is shown below:
{
"status": 200,
"timestamp": 1756824596847
}Request a promo abuse recommendation
Was this page helpful?