The Referral Rewards API allows you to retrieve information about referral rewards on your Wix site. With this API, you can access data about rewards given to customers who participate in your referral program.
With the Referral Rewards API, you can:
See the Wix Referral Program: Adding and Setting Up Your Referral Program article for more information on setting up and managing referral programs on your Wix site.
It's important to note the following points before starting to code:
The following table shows field support for filters and sorting for the Referral Reward object:
Field | Query Filter Operators | Sortable |
---|---|---|
rewardedReferringCustomerId | $eq , $ne , $hasSome , $exists , $startsWith , $in , $nin | Sortable |
rewardedReferredFriendId | $eq , $ne , $hasSome , $exists , $startsWith , $in , $nin | Sortable |
rewardType | $eq , $ne , $hasSome , $in , $nin , $exists | Sortable |
createdDate | $eq , $ne , $lt , $lte , $gt , $gte , $hasSome , $in , $nin , $exists | Sortable |
updatedDate | $eq , $ne , $lt , $lte , $gt , $gte , $hasSome , $in , $nin , $exists | Sortable |
Related content: API Query Language, Query Referral Rewards endpoint
Referral reward ID.
Revision number, which increments by 1 each time the referral reward is updated. To prevent conflicting changes, the current revision must be passed when updating the referral reward.
Date and time the referral reward was created.
Date and time the referral reward was last updated.
Type of reward given.
ID of the referring customer who received the reward.
ID of the referred friend who received the reward.
Details of a coupon reward. Present when reward_type
is COUPON
.
Details of a loyalty points reward. Present when reward_type
is LOYALTY_POINTS
.
{
"referralReward": {
"id": "c8c732cf-2ca2-4025-9b1c-3be02f099cdb",
"revision": "2",
"createdDate": "2024-07-08T11:22:00.728Z",
"updatedDate": "2024-07-08T11:27:57.197Z",
"rewardType": "COUPON",
"rewardedReferringCustomerId": "4fb41de4-da9c-4818-b54f-82c955ecc866",
"coupon": {
"id": "43fa238a-b464-4a5b-9079-5682a5a1eab7",
"code": "6QW1ASGTZ0Q4",
"status": "APPLIED",
"couponSpecification": {
"name": "Your reward",
"discountType": "FIXED_AMOUNT",
"limitedToOneItem": true,
"appliesToSubscriptions": null,
"discountedCycleCount": null,
"fixedAmountOptions": {
"amount": 10
},
"scope": {
"namespace": "stores",
"group": null
}
}
}
}
}
Retrieves a referral reward.
Referral reward ID.
Retrieved referral reward.
curl -X GET \
'https://www.wixapis.com/_api/referral-rewards/v1/referral-rewards/c8c732cf-2ca2-4025-9b1c-3be02f099cdb' \
-H 'Authorization: <AUTH>'
{
"referralReward": {
"id": "c8c732cf-2ca2-4025-9b1c-3be02f099cdb",
"revision": "2",
"createdDate": "2024-07-08T11:22:00.728Z",
"updatedDate": "2024-07-08T11:27:57.197Z",
"rewardType": "COUPON",
"rewardedReferringCustomerId": "4fb41de4-da9c-4818-b54f-82c955ecc866",
"coupon": {
"id": "43fa238a-b464-4a5b-9079-5682a5a1eab7",
"code": "6QW1ASGTZ0Q4",
"status": "APPLIED",
"couponSpecification": {
"name": "Your reward",
"discountType": "FIXED_AMOUNT",
"limitedToOneItem": true,
"appliesToSubscriptions": null,
"discountedCycleCount": null,
"fixedAmountOptions": {
"amount": 10
},
"scope": {
"namespace": "stores",
"group": null
}
}
}
}
}
Retrieves a list of referral rewards, given the provided paging, filtering, and sorting.
To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.
Query to filter referral rewards.
Contact ID to filter rewards by. Use "me"
for current identity's rewards.
Retrieved referral rewards.
Metadata for paging.
curl -X POST \
'https://www.wixapis.com/_api/referral-rewards/v1/referral-rewards/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"query": {
"sort": [
{
"order": "DESC",
"fieldName": "revision"
}
],
"filter": {
"rewardType": "CouponReward"
}
},
"contactId": "me"
}'
{
"referralRewards": [
{
"id": "c8c732cf-2ca2-4025-9b1c-3be02f099cdb",
"revision": "2",
"createdDate": "2024-07-08T11:22:00.728Z",
"updatedDate": "2024-07-08T11:27:57.197Z",
"rewardType": "COUPON",
"rewardedReferringCustomerId": "4fb41de4-da9c-4818-b54f-82c955ecc866",
"coupon": {
"id": "43fa238a-b464-4a5b-9079-5682a5a1eab7",
"code": "6QW1ASGTZ0Q4",
"status": "APPLIED",
"couponSpecification": {
"name": "Your reward",
"discountType": "FIXED_AMOUNT",
"limitedToOneItem": true,
"appliesToSubscriptions": null,
"discountedCycleCount": null,
"fixedAmountOptions": {
"amount": 10
},
"scope": {
"namespace": "stores",
"group": null
}
}
}
}
],
"metadata": {
"count": 1,
"cursors": {},
"hasNext": false
}
}