Use Rest API to retrieve the shortened link for refferal
Last updated 2 hours 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": {} }
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": "2024-10-03T13:29:49.483Z", "createdAt": "2024-10-03T13:29:49.483Z" } ], "pageInfo": { "hasPre": false, "hasNext": false } }