Using Transaction Attributes as filters in APIs to fetch rewards

Introduction

To filter out rewards based on personalization rules, you can pass custom transaction attributes in three different APIs within the Zinrelo platform. These APIs include:

There are different filter criteria on which rewards can be filtered in the given APIs.

  • In Get Eligible Reward by Member ID and Zinrelo Generated Member ID API:
    • Filter criteria: In these APIs, you can apply filters based on Global Attributes, Reward Global Attributes, and Local Attributes.
  • List All Rewards API:
    • Filter criteria: The List All Rewards API allows you to filter rewards based on Global Attributes and Reward Global Attributes.

By utilizing these filters, you gain precise control over the rewards you retrieve from the Zinrelo platform. This level of customization enables you to deliver targeted rewards to your users, enhancing their engagement and satisfaction within your loyalty program.

To know more about the custom transaction attributes, click here.

How can I use custom transaction attributes to filter rewards?

You can pass custom transaction attributes through the API. This help document will guide you through passing custom transaction attributes using Postman. For this, you need to install Postman on your system.

To prepare your Postman for Zinrelo APIs and ensure its proper configuration, please refer to the Postman help document.

Now let's get started.

Let's assume, "Store Name" is the custom transaction attributes created for the store.

You can pass "Store Name" in the API to filter out the rewards. Let's see how can we use this attribute in the APIs.

List All Rewards API

To utilize the List All Rewards API, please follow the steps below:

  1. Click on the "Import" button in Postman to import the API request.
Postman
  1. Paste the provided cURL request into the designated box:
curl -X GET \
  'https://api.zinrelo.com/v2/loyalty/rewards?Storename=Walmart' \
  -H 'api-key: your-api-key' \
  -H 'content-type: application/json' \
  -H 'partner-id: your_partner_id'

Note: Replace "your-api-key" and "your_partner_id" with your store's API key and Partner ID.

  1. The request should appear as follows:

Please Note: "Storename" is the client internal ID, which has to be replaced with custom transaction attribute you created for your store.

📘

Please note:

The client internal id (custom transaction attribute ID generated by Zinrelo) should be created in advance. To create custom attributes for your store, reach out to your account manager at [email protected].

  1. Customizing the request:
  • Every client internal ID should be passed with the corresponding value.
  1. Click on the "Send" button in Postman to execute the API request.

Get Eligible Reward by Member ID and Zinrelo Generated Member ID API

To utilize the Get Eligible Reward by Member ID and Zinrelo Generated Member ID API, please follow the steps below:

  1. Click on the "Import" button in Postman to import the API request.
Postman
  1. Paste the provided cURL request into the designated box:
curl -X GET \
'https://api.zinrelo.com/v2/loyalty/members/[email protected]/rewards?idParam=member_id&Storename=Walmart' \
  -H 'api-key: your-api-key' \
  -H 'content-type: application/json' \
  -H 'partner-id: your-partner-id' \

Note: Replace "your-api-key" and "your_partner_id" with your store's API key and Partner ID.

  1. The request should appear as follows:

Please Note: "Storename" is the client internal ID, which has to be replaced with custom transaction attribute you created for your store.

📘

Please note:

The client internal id (custom transaction attribute ID generated by Zinrelo) should be created in advance. To create custom attributes for your store, reach out to your account manager at [email protected].

  1. Customizing the request:
  • Every client internal ID should be passed with the corresponding value.
  • Update "idParam" parameter value with the member_id of the individual for whom you wish to retrieve the eligible rewards.
  1. Click on the "Send" button in Postman to execute the API request.