Joy dev docs
User guide
  • Joy Javascript API
    • Introduction to the Joy SDK
    • Public API get methods
    • Public API action methods
    • Widget methods
  • Joy REST API
    • Customers
    • Earning programs
    • Redeeming programs
    • Points history
    • Rewards
    • Point manupulation
    • VIP Tiers
    • Referral
  • JOY OPEN API V2
    • Customer
Powered by GitBook
On this page
  1. Joy REST API

Referral

Use Rest API to retrieve the shortened link for refferal

PreviousVIP TiersNextCustomer

Last updated 7 months ago

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
  }
}
  • POSTGet referral link
  • GETGet list refer by shopify customer id
  • GETGet total redeemed coupons and points earned from referrals

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": "demo@email.com",
      "email": "h*****h@email.com,",
      "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": "demo@email.com",
      "email": "a*****f@email.com,",
      "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": "demo@email.com",
      "email": "b*****e@email.com,",
      "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 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": "customer@example.com"
}
200

OK

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