Every activity has a two predefined transaction attributes - reason and tags. While awarding points for an activity, data can be passed in these attributes.
Custom attributes: In addition to the predefined attributes, you can define custom attributes for each activity and pass data in those attributes.
The custom attribute should be created in advance. To create custom attributes for your store, reach out to your account manager at support.zinrelo.com.
Note: "transaction_attributes" is mandatory only for 3 of the predefined activities.
made_a_purchase activity
Mandatory attributes are order_id, order_total, order_subtotal.
The order_subtotal should be greater than 0.01
A sample structure of the transaction_attributes for the made_a_purchase activity is given below:
{
"tags" : ["tag1","tag2"],
"reason" : "purchase",
"order_id" : "75",
"coupons" : "$5OFFVYZ,$10FFEDT,$05RTNVLW",
"order_total" : "1000",
"order_subtotal" : "1000",
"products" : [{
"product_id": "112",
"product_quantity": "1",
"product_category": "tshirt, blue range, on sale",
"product_price": "15",
"product_title": "Sweatshirt",
"product_image_url": ""
},
{
"product_id": "980",
"product_quantity": "2",
"product_category": "sales, straight range of pants, formals, on 10% discount",
"product_price": "10.017",
"product_title": "Pant",
"product_image_url": ""
}]
}
Note:
- The attributes like “product_id”, “product_price”, “product_quantity” and “product_title” are mandatory only when you pass product attributes.
- The order subtotal should be calculated as the sum of the subtotals of all products in the order, without taking into account any discounts. The discounted price needs to be adjusted in products and passed accordingly.
- We are also accepting product quantity in decimal values.
- When individual product prices are provided, the subtotal is ignored.
- In instances where product information is absent, the purchase amount is derived from the 'order_subtotal' field.
submit_a_receipt activity
Mandatory attribute is 'receipt_files'. 'receipt_uid' is the optional field. Expected data is a list of images/pdfs encoded in base64 format. To convert an image to base64 format, click here.
A sample structure of the transaction_attributes for the submit_a_receipt activity is given below:
{"receipt_files":[""]}
upload_photo activity
Mandatory attribute is image_file. Expected data is a list of images/pdfs encoded in base64 format. To convert an image to base64 format, click here.
A sample structure of the transaction_attributes for the upload_photo activity is given below:
{"image_file": [""]}
To know more about the transaction attributes for Award API, click here.