In Zinrelo, point-earning opportunities are termed "activities." Think of these as the behaviours that you want to incentivize. E.g., make a purchase, write a review, daily login, advance booking, etc. Activities will create point credit transactions. Think of transactions as records in the members’ points ledger. The transactions created against activities will abide by the rules set in the activities and will also contain the data for the various transaction attributes defined in the activity, if any.
The activity object will contain the attributes that define the activity settings—how many points to award; activity name; activity ID; text configuration; which member segments to enable the activity for; and custom transaction attributes.
A sample JSON of the activities object is shown below.
{
"id" : "5087ffaabbccy677ffc7995f",
"activity_id" : "made_a_purchase",
"activity_name" : "Made a purchase",
"is_active" : "True",
"points_computation_type": "multiplier_based",
"approval_method" : "immediate",
"show_on_guest_dashboard": "True",
"activity_card_background_image_url" : "https://d1qbqkkh49kht1.cloudfront.net/fb112084ec96f50e717a86bb8d52d589.png",
"is_qualified_for_tier_upgrade" : "True",
"enduser_activity_short_description" : "Earn 10 points per dollar spent",
"enduser_activity_description_html" : "<div> Make a purchase on our website or in the store and earn 10 points for every dollar you spend.<br> Amazing rewards and exciting benefits await you.</div>",
"points_config" : {
"multiplier" : "10",
"attribute_to_multiply" : "order_subtotal"
},
"rules_config" : [
{
"rule_type" : "bonus_multiplier",
"rule_value" : "1",
"is_active" : "True",
"conditions" : [
{
"operator" : "Between",
"attribute" : "Transaction Date",
"value" : "11/1/2021-2/28/2023"
},
"AND",
{
"operator" : "Contain all of",
"attribute" : "User Tags",
"value" : ["cohortA"]
},
"AND"
]
}
],
"member_eligibility_rules": [ {
"show_on_member_dashboard" : "True",
"include_in_api_response" : "False",
"conditions" : [
{
"operator" : "Between",
"attribute" : "Enrolment Date",
"value" : "11/1/2021-2/28/2023"
},
"AND",
{
"operator" : "Contain all of",
"attribute" : "Member Tags",
"value" : ["cohortA"]
},
]
},
{
"show_on_member_dashboard" : "True",
"include_in_api_response" : "False",
"conditions" : [
{
"operator" : "Contain all of",
"attribute" : "Member Tags",
"value" : ["cohortC”, “cohortD"]
}
]
}
],
"custom_transaction_attributes" : [
{
"attribute_name" : "Order ID",
"attribute_type" : "Text",
"attribute_id" : "order_id",
"is_attribute_mandatory" : "True",
},
{
"attribute_name" : "Order Subtotal",
"attribute_type" : "Number",
"attribute_id" : "order_subtotal",
"is_attribute_mandatory" : "True",
},
{
"attribute_name" : "Order Total",
"attribute_type" : "Number",
"attribute_id" : "order_total",
"is_attribute_mandatory" : "True",
},
{
"attribute_name" : "Products",
"attribute_type" : "List",
"type_of_attribute_in_list" : "Dictionary",
"attribute_id" : "products",
"is_attribute_mandatory" : "False",
"sub_attributes" : [
{
"attribute_name" : "Product ID",
"attribute_type" : "Number",
"attribute_id" : "product_id",
"is_attribute_mandatory" : "True",
},
{
"attribute_name" : "Product Price",
"attribute_type" : "Number",
"attribute_id" : "product_price",
"is_attribute_mandatory" : "True",
},
{
"attribute_name" : "Product Title",
"attribute_type" : "Text",
"attribute_id" : "product_title",
"is_attribute_mandatory" : "True",
}
]
}
]
"last_modified_date" : "12/29/2021 16:47:40",
"created_date" : "10/13/2019 01:47:40",
}
The activities resource will have the following API endpoints:
- Retrieve an activity
- List all activities
- List all the activities a member is eligible for.