Transactions

In Zinrelo, transactions are the records that get created for any point credit or debit action. 

Credit transactions are created when members perform activities that earn points, such as account creation, purchases, anniversary bonus, surveys, referrals

Debit transactions are created when-

  • members redeem their points for rewards, or 
  • their points expire, or
  • their points are deducted manually or programmatically.

When activities are recorded via APIs, the transactions created against those activities may contain the values for the custom attributes defined against the activity being recorded. Similarly, if a redemption is being carried out via an API, the transactions created against those activities may contain the values for the custom attributes defined against the reward being redeemed.

Award Transaction Object

{
           "id" : "5677ffaabbccyffc6775f",  
           "transaction_type" : "award", 
           "member_id" : "7203332525", 
           "award_info" : {
                 "activity_id" :  "made_a_purchase", 
                 "activity_name" : "Made a purchase", 
                 "points_status" : "Approved", 
                 "points" : "360"  
           }, 
          "transaction_attributes" : {
                "tags" :  "Instore, Superior", 
                "reason" : "Purchase",
                "order_id" : "772345", 
                "order_total" : "45.00",
                "order_subtotal" : "36.00", 
                "coupons" : "$5OFFVYZ", 
                "currency" : "USD",
                "products" : [
                  {
                       "product_id" : "98011",
                       "product_category" : "Essentials",
                       "product_price" : "36.00", 
                       "product_title" : "Relaxed Fit Sweatshirt - Mint green",
                       "product_image_url" : "https://lp2.hm.com/hmgoepprod?set=quality"
                  }
                ]
           }, 
          "auto_approval_date" : "02/27/2022 01:47:40",               
          "approved_date" : "12/29/2021 16:47:40", 
          "approver_details" : {
                     "approver_id" : "5677ffaaffc6775fbbccy", 
                     "approver_name" : "Jake F"
           }, 
          "points_expiration_date" :  "06/28/2022 16:47:40",
          "last_modified_date" : "01/28/2022 16:47:40", 
          "created_date" : "01/27/2022 01:47:40"                    
  }

Redeem Transaction Object

{
           "id" : "ffaabbccy75f656777",  
           "transaction_type" : "redeem", 
           "member_id" : "7203332525", 
           "reward_info" : {
                 "reward_id" :  "$5OFF_coupon", 
                 "activity_name" : "$5OFF Coupon", 
                 "points_status" : "Redeemed", 
                 "points" : "500",
                 "coupon_code" : "XVFDGT56RT"
           }, 
          "transaction_attributes" : {
                "tags" : "Discount", 
                "reason" : "Redeemed 500 points for $5 OFF coupon",
                "source_of_redemption" : "POS"
           }, 
          "approved_date" : "01/27/2022 16:47:40", 
          "approver_details" : {
                     "approver_id" : "None", 
                     "approver_name" : "System"
           }, 
          "last_modified_date" : "01/27/2022 16:47:40", 
          "created_date" : "01/27/2022 16:47:40"                    
  }

Deduct Transaction Object

{
           "id" : "bbccy75fffaa656777",  
           "transaction_type" : "deduct", 
           "member_id" : "7203332525", 
           "deduct_info" : {
                 "points_status" : "Deducted", 
                 "points" : "360",
           }, 
          "transaction_attributes" : {
                "tags" : "ProductReturn, InstoreReturn", 
                "reason" : "Order partially returned",
                "order_id": "772345", 
                "returned_amount" : "36.00", 
                "returned_product_id" : "98011", 
                "returned_product_quantity" : "1"
           }, 
          "approved_date" : "02/27/2022 16:47:40", 
          "approver_details" : {
                     "approver_id" : "None", 
                     "approver_name" : "System"
           }, 
          "last_modified_date" : "02/27/2022 16:47:40", 
          "created_date" : "02/27/2022 16:47:40"                    
  }

The transactions resource will have the following API endpoints: 

  • Create an award transaction.
  • Create a redeem transaction.
  • Create a deduct transaction.
  • Approve a pending award transaction.
  • Reject a pending award transaction.
  • Modify a pending award transaction.
  • Retrieve a transaction.
  • List all transactions.
  • List all transactions for a loyalty member.
  • Create a return transaction [Specific to retail scenario where the primary activity is Purchase]
  • Reverse an award transaction.