Home
Referrals

event_friend_incentive_request

This event occurs when a friend clicks on the referral link shared by a user and enters their email to claim a reward.

This event is related to the "Refer a Friend" activity. This event is triggered as soon as the coupon is dispatched to the friend's email address.

Request

We send events to your webhook's URL with POST and a JSON body. Events are batched: a request can carry several events of this type. See Receiving Webhooks for batch sizes and retries, and Webhook Event Signatures to verify the request.

Headers

HeaderDescription
x-zinrelo-signatureThe HMAC-SHA512 hex digest of <request body>:<nonce>, computed with the webhook's secret key. See Webhook Event Signatures.
nonceThe Unix time, in milliseconds, at which the request was signed. It's part of the signed message.

Payload

FieldTypeDescription
request_idstringA unique identifier of this webhook request.
total_countintegerThe number of events in the batch (events).
created_datestringWhen the webhook request was created, as MM/DD/YYYY HH:MM:SS.
eventsarray of objectThe events in this batch.
events[].idstringThe unique identifier of the event. Use it to detect events you already processed.
events[].event_typestringThe type of event. One of event_friend_incentive_request.
events[].dataobjectThe event's data.
events[].data.friend_info (optional)objectThe friend_info object of the event's data. Which fields are present depends on the event.
events[].data.friend_info.email_address (optional)stringThe email address of the member.
events[].data.friend_info.id (optional)stringThe internal ID generated by TrueLoyal.
events[].data.friend_info.first_name (optional)stringThe first name of the member.
events[].data.friend_info.last_name (optional)stringThe last name of the member.
events[].data.friend_info.address (optional)object
events[].data.friend_info.address.city (optional)stringMember's city.
events[].data.friend_info.address.country (optional)stringMember's country.
events[].data.friend_info.address.line2 (optional)stringThe member address.
events[].data.friend_info.address.line1 (optional)stringThe member address.
events[].data.friend_info.address.state (optional)stringMember's state.
events[].data.friend_info.address.postal_code (optional)stringMember's postal code.
events[].data.friend_info.phone_number (optional)stringThe phone number of the member.
events[].data.friend_info.member_id (optional)stringThe unique identifier of the member defined by an Admin.
events[].data.friend_info.member_status (optional)stringThe current status of the member- ‘active’ , ‘blocked’, ‘opted_out’. ‘active’ member is the one accumulating loyalty points and has access to rewards and earning opportunities. ‘blocked’ member is prohibited from participating in the program. ‘opted_out’ member is the one who has chosen to opt out of the loyalty program.
events[].data.friend_info.member_tags (optional)array of stringThe tags assocaited with a member.
events[].data.friend_info.number_of_purchases (optional)integerThe number of purchases made by a member.
events[].data.friend_info.number_of_redemptions (optional)integerThe number of redemptions made by a member.
events[].data.friend_info.birthdate (optional)stringBirthdate of the loyalty member. Expected date format: MM/DD/YYYY or MM/DD Irrespective of the year passed, 1904 will be set as a default value.
events[].data.friend_info.enrollment_date (optional)stringThe date on which the member joined the loyalty program.
events[].data.friend_info.last_modified_date (optional)stringThe most recent date on which a member's profile was updated.
events[].data.friend_info.first_purchase_date (optional)stringThe first purchase date of the member.
events[].data.friend_info.instagram_handle (optional)stringThe instagram handle of the member.
events[].data.friend_info.last_purchase_date (optional)stringThe last purchase made by a member.
events[].data.friend_info.anniversary_date (optional)stringThe anniversary date of the member. Expected date format: MM/DD/YYYY or MM/DD In case, where a year has not been passed the default year will be set as 1904.
events[].data.friend_info.twitter_handle (optional)stringThe twitter handle of the member.
events[].data.friend_info.preferred_language (optional)stringThe preferred language of the member.
events[].data.friend_info.tier_info (optional)object
events[].data.friend_info.tier_info.tier_qualification_units (optional)integer
events[].data.friend_info.tier_info.current_period_start (optional)stringThe start date of the current tier cycle.
events[].data.friend_info.tier_info.loyalty_tier_name (optional)stringThe name of the current tier.
events[].data.friend_info.tier_info.qualified_points (optional)integerThe qualified points for tier calculation.
events[].data.friend_info.tier_info.loyalty_tier_id (optional)stringThe unique tier ID stored in TrueLoyal.
events[].data.friend_info.tier_info.current_period_end (optional)stringThe end date of current tier cycle.
events[].data.friend_info.lifetime_points_earned (optional)integerThe total points earned in a member's account since he joined the program.
events[].data.friend_info.lifetime_points_expired (optional)integerThe total points expired from a member's account since he joined the program.
events[].data.friend_info.available_points (optional)integerThe avaliable points of the member.
events[].data.friend_info.points_onhold (optional)integer
events[].data.friend_info.lifetime_points_deducted (optional)integerThe total points deducted from a member's account since he joined the program.
events[].data.friend_info.lifetime_points_redeemed (optional)integerThe total points redeemed from a member's account since he joined the program.
events[].data.friend_info.referral_URL (optional)stringThe unique referral url of the member.
events[].data.friend_info.custom_attributes (optional)object
events[].data.friend_info.custom_attributes.Gender (optional)array of string
events[].data.friend_info.custom_attributes.Number of purchases (optional)integer
events[].data.friend_info.custom_attributes.List of favourite place (optional)array of string
events[].data.friend_info.custom_attributes.Review date (optional)string
events[].data.friend_info.custom_attributes.City_Name (optional)string
events[].data.friend_info.custom_attributes.Marital_Status (optional)string
events[].data.friend_info.custom_attributes.Income_Source (optional)string
events[].data.friend_info.custom_attributes.Age_In_Years (optional)string
events[].data.friend_info.custom_attributes.Gender_Identity (optional)string
events[].data.friend_info.custom_attributes.Graduation_Date (optional)string
events[].data.friend_info.revenue (optional)integer
events[].data.friend_info.aov (optional)number
events[].data.friend_info.deleted_date (optional)null
events[].data.friend_info.referral_code (optional)stringThe unique referral code of the member.
events[].data.incentive_info (optional)objectThe incentive_info object of the event's data. Which fields are present depends on the event.
events[].data.incentive_info.coupon (optional)string
events[].data.incentive_info.referrer_info (optional)object
events[].data.incentive_info.referrer_info.referral_link (optional)string
events[].data.incentive_info.referrer_info.member_id (optional)stringThe unique identifier of the member defined by an Admin.
events[].data.incentive_info.referrer_info.id (optional)stringThe internal ID generated by TrueLoyal.

Examples

New friend

{
  "request_id": "6333fb9e1ddab5000ba5e74a",
  "total_count": 1,
  "events": [
    {
      "id": "6333fba0fa6dbb793c3ecb73",
      "event_type": "event_friend_incentive_request",
      "data": {
        "friend_info": {
          "email_address": "annascott286@gmail.com"
        },
        "incentive_info": {
          "coupon": "FRIEND10",
          "referrer_info": {
            "referral_link": "https://zinrelo.com/ref/WEB7AMEU",
            "member_id": "anna598",
            "id": "63b3ec0a4df04512da0882d3"
          }
        }
      }
    }
  ],
  "created_date": "09/28/2022 07:45:34"
}

Friend already enrolled

{
  "request_id": "6336e12cca5ac5000af2805e",
  "total_count": 1,
  "events": [
    {
      "id": "6336e12eeecc0c196e9e50d7",
      "event_type": "event_friend_incentive_request",
      "data": {
        "friend_info": {
          "id": "633689b8fe0c0000093bc10a",
          "first_name": "John",
          "last_name": "Doe",
          "email_address": "johndoe@gmail.com",
          "address": {
            "city": "Palo Alto",
            "country": "US",
            "line2": "530 Lytton Ave",
            "line1": "Suite #200",
            "state": "CA",
            "postal_code": "94301"
          },
          "phone_number": "+1-6507017759",
          "member_id": "johndoe55",
          "member_status": "active",
          "member_tags": [
            "member1",
            "member2"
          ],
          "number_of_purchases": 1,
          "number_of_redemptions": 0,
          "birthdate": "08/26/1989 00:00:00",
          "enrollment_date": "09/30/2022 00:00:00",
          "last_modified_date": "09/30/2022 00:00:00",
          "first_purchase_date": "09/30/2022 00:00:00",
          "instagram_handle": "www.instagram.com/john",
          "last_purchase_date": "09/30/2022 00:00:00",
          "anniversary_date": "12/06/2014 00:00:00",
          "twitter_handle": "www.twitter.com/john",
          "preferred_language": "English",
          "tier_info": {
            "tier_qualification_units": 100,
            "current_period_start": "09/01/2022 00:00:00",
            "loyalty_tier_name": "Gold",
            "qualified_points": 1000,
            "loyalty_tier_id": "zrl_gold",
            "current_period_end": "09/30/2022 23:59:59"
          },
          "lifetime_points_earned": 1100,
          "lifetime_points_expired": 0,
          "available_points": 1100,
          "points_onhold": 10,
          "lifetime_points_deducted": 0,
          "lifetime_points_redeemed": 0,
          "referral_URL": "zinrelo.com/ref/JOH1HQK8",
          "custom_attributes": {
            "Gender": [
              "Male",
              "Female"
            ],
            "Number of purchases": 1,
            "List of favourite place": [
              "London",
              "Paris"
            ],
            "Review date": "12/10/2022 00:00:00"
          },
          "revenue": 100,
          "aov": 1.7,
          "deleted_date": null
        }
      }
    }
  ],
  "created_date": "09/30/2022 12:29:32"
}

Responses

StatusDescription
200Acknowledges receipt of the events. Return 200 as soon as you receive the request and process the events afterwards, so the request doesn't time out.
OtherAny status code other than 200 is a failure: the request is sent again every 5 minutes until your endpoint returns 200 or the maximum number of attempts (5 by default) is reached. Your Customer Success Manager can change these settings.