Use Rest API to retrieve the shortened link for refferal
Last updated 3 months ago
OK
const response = await fetch('https://dev-api.joy.so/rest_api/v1/referral/summary/{shopifyCustomerId}', { method: 'GET', headers: {}, }); const data = await response.json();
{ "data": { "totalRedeemCoupon": 1, "totalPointEarnRefer": 2720 } }
const response = await fetch('https://dev-api.joy.so/rest_api/v1/referral/getLink', { method: 'POST', headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "email": "customer@example.com" }), }); const data = await response.json();
const response = await fetch('https://dev-api.joy.so/rest_api/v1/referral/{shopifyCustomerId}', { method: 'GET', headers: {}, }); const data = await response.json();
{ "data": [ { "id": "text", "referralCustomerEmail": "text", "statusReferral": "pending_referral", "customerId": "text", "couponCode": "text", "email": "text", "updatedAt": "2025-01-22T05:27:50.689Z", "createdAt": "2025-01-22T05:27:50.689Z" } ], "count": 0, "pageInfo": { "hasPre": false, "hasNext": false } }
const response = await fetch('https://dev-api.joy.so/rest_api/v1/referral/analytics/clicks-usage', { method: 'GET', headers: {}, }); const data = await response.json();
{ "data": { "countReferralLinkClicks": 14, "countCouponCodeUsage": 4, "totalLinkClickers": 2 } }