Referral

Use Rest API to retrieve the shortened link for refferal

Get referral link

post
Header parameters
X-Joy-Loyalty-App-KeystringOptionalExample: {{appKey}}
X-Joy-Loyalty-Secret-KeystringOptionalExample: {{secretKey}}
Body
emailstringRequired
Responses
200
OK
application/json
post
POST /rest_api/v1/referral/getLink HTTP/1.1
Host: dev-api.joy.so
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "email": "[email protected]"
}
200

OK

{
  "data": {
    "urlReferral": "https://joy-dev.com/i/Ln2M"
  }
}

Get list refer by shopify customer id

get
Path parameters
shopifyCustomerIdstringRequired
Header parameters
X-Joy-Loyalty-App-KeystringOptionalExample: {{appKey}}
X-Joy-Loyalty-Secret-KeystringOptionalExample: {{secretKey}}
Responses
200
OK
application/json
get
GET /rest_api/v1/referral/{shopifyCustomerId} HTTP/1.1
Host: dev-api.joy.so
Accept: */*
200

OK

{
  "data": [
    {
      "id": "J9JT65z3Ne8vHUo1lItr",
      "referralCustomerEmail": "[email protected]",
      "email": "h*****[email protected],",
      "couponCode": "JOY-02Q47LXBY1OJ",
      "customerId": "EFqXuCw5jszwXCJ5N6b2",
      "statusReferral": "pending_referral",
      "createdAt": "2024-09-22T17:02:26.394Z",
      "updatedAt": "2024-09-22T17:02:26.394Z"
    },
    {
      "id": "A8JT65z3Ne8cHUo1lItr",
      "referralCustomerEmail": "[email protected]",
      "email": "a*****[email protected],",
      "couponCode": "JOY-02Q47LXBY1OJ",
      "customerId": "EFqXuCw5jszwXCJ5N6b2",
      "statusReferral": "complete_referral",
      "createdAt": "2024-08-22T17:02:26.394Z",
      "updatedAt": "2024-08-22T17:02:26.394Z"
    },
    {
      "id": "9OJT65z3Ne8cHUo1lItr",
      "referralCustomerEmail": "[email protected]",
      "email": "b*****[email protected],",
      "couponCode": "JOY-02Q47LXBY1OJ",
      "customerId": "EFqXuCw5jszwXCJ5N6b2",
      "statusReferral": "cancel_referral",
      "createdAt": "2024-07-22T17:02:26.394Z",
      "updatedAt": "2024-07-22T17:02:26.394Z"
    }
  ],
  "count": 3,
  "pageInfo": {
    "hasPre": false,
    "hasNext": false
  }
}

Get total redeemed coupons and points earned from referrals

get
Path parameters
shopifyCustomerIdstringRequired
Header parameters
X-Joy-Loyalty-App-KeystringOptionalExample: {{appKey}}
X-Joy-Loyalty-Secret-KeystringOptionalExample: {{secretKey}}
Responses
200
OK
application/json
get
GET /rest_api/v1/referral/summary/{shopifyCustomerId} HTTP/1.1
Host: dev-api.joy.so
Accept: */*
200

OK

{
  "data": {
    "totalRedeemCoupon": 1,
    "totalPointEarnRefer": 2720
  }
}

Last updated