Skip to content

Loyalty Event Objects

Every Content Block have some respective event objects that are required by the events to be used. These event objects can be referred to as item properties for that event or model/data classes that are required for that event. These objects provide a detailed context to the event about the element they are associated with.

List of Objects

Here's a list of objects that are required in core module events.

Object Name Usability Description
Promo Item Object items Track the items associated to a promo.
Survey Object survey Track values regarding survey in the app.
Response Object response Track the values regarding survey responses of the user.
Redeem Object redeem Track the elements regarding redeeming of the reward/loyalty points in the app.


Promo Item Object

Before looking into the events that we have below, here is the following item min object that will be used repeatedly in our events below, especially in promo event. This is to be used in places where we don't require all the details about the item.

Format

Param Usability Format Enum Values Description
id REQUIRED STRING --- Id of the Item in the event.
type REQUIRED STRING drug, blood, oxygen, medical_equipment, grocery Type of the item in question.

Usage

    val item = PromoItemObject(
        id = "item1", 
        type = "drug"
    )
    let promoItem = {
      id: "itemId1",
      type: PromoItemType.Drug,
    }
    let promoItem = {
      id: "itemId1",
      type: PromoItemType.Drug,
    }
{
  "item": {
    "id": "TestItemId",
    "type": "drug"
  }
}


Survey Object

Before looking into the events that we have below, here is the following survey object that will be used repeatedly in our events below, especially in survey event.

Format

Param Usability Format Enum Values Description
id REQUIRED STRING --- Id of the survey in the event.
type REQUIRED STRING open_ended, closed_ended, nominal, likert_scale, rating_scale, yes_no, interview, other Type of the survey in question.
is_completed REQUIRED BOOLEAN --- Is survey completed.
reward_id OPTIONAL STRING --- Id of the reward associated to survey.

Usage

    val survey = SurveyObject(
            id = "Some SurveyId",
            is_completed = true,
            reward_id = "testRewardId",
            type = SurveyType.open_ended.name,
        )
    let surveyObject = {
        id: "surveyId1",
        type: SurveyType.OpenEnded,
        is_completed: true,
        reward_id: "testRewardId"
    }
    let surveyObject = {
        id: "surveyId1",
        type: SurveyType.OpenEnded,
        is_completed: true,
        reward_id: "testRewardId"
    }
{
  "survey": {
    "id": "surveyId",
    "type": "open_ended",
    "is_completed": true,
    "reward_id": "testRewardId"
  }
}


Response Object

Before looking into the events that we have below, here is the following response object that will be used repeatedly in our events below, especially in survey event.

Format

Param Usability Format Enum Values Description
id REQUIRED STRING --- Id of the question in the event.
type REQUIRED STRING open_ended, closed_ended, nominal, likert_scale, rating_scale, yes_no, interview, other Type of the question in survey.
question REQUIRED STRING --- Question statement for survey.
response OPTIONAL STRING --- Response to the question for survey.

Usage

    val responseItem = SurveyResponseItem(
                id = "345345",
                question = "Some Question Text",
                response = "Some Answer Text",
                type = SurveyType.open_ended.name
            )
    let responseItem = {
        id: "itemId2",
        type: SurveyType.OpenEnded,
        question: "hello world",
        response = "Some Answer Text",
    }
    let responseItem = {
        id: "itemId2",
        type: SurveyType.OpenEnded,
        question: "hello world",
        response = "Some Answer Text",
    }
{
  "response": {
    "id": "345345",
    "question": "Some Question Text",
    "response": "Some Answer Text",
    "type": "open_ended"
  }
}


Redeem Object

Before looking into the events that we have below, here is the following redeem object that will be used repeatedly in our events below, especially in reward event.

Format

Param Usability Format Enum Values Description
type REQUIRED STRING cash, airtime, other Type of the redeem in the event.
is_successful REQUIRED BOOLEAN --- Is the redeem successful.
points_withdrawn REQUIRED FLOAT --- Points withdrawn from the redeem.
converted_value REQUIRED FLOAT --- Converted value for the redeem.
currency OPTIONAL STRING --- Currency Code for the redeem if it is a cash redeem. Only required for cash type.

Usage

    val redeemObject = RedeemObject(
            type = RedeemType.cash.name,
            points_withdrawn = 0.1f,
            converted_value = 2.3f,
            currency = "EUR",
            is_successful = true
        )
    let redeemObject = {
        type: RedeemType.Cash,
        points_withdrawn: 2,
        converted_value: 5,
        currency: CurrencyCode.EUR,
        is_successful: true
    }
    let redeemObject = {
        type: RedeemType.Cash,
        points_withdrawn: 2,
        converted_value: 5,
        currency: CurrencyCode.EUR,
        is_successful: true
    }
{
  "redeem": {
    "type": "cash",
    "is_successful": true,
    "points_withdrawn": 0.1,
    "converted_value": 2.3,
    "currency": "USD"
  }
}