Using Transaction Attributes as filters in APIs to fetch rewards

In this article, we will cover:

Introduction

To filter out rewards based on personalization rules, you can pass custom transaction attributes in three different APIs within the TrueLoyal 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 TrueLoyal 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 TrueLoyal 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, see Loyalty Custom Attributes.

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. Now let's get started.

Let's assume, "Store Name" is the custom transaction attribute created for the store. You can pass "Store Name" in the API to filter out the rewards. Let's see how we can 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 My Workspace toolbar showing the New and Import buttons

  2. 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.

    To obtain your Partner ID, go to General >> Settings. For the API key, navigate to General >> API Keys and select the API key you created for this purpose.

    Please note: The API Keys section under General is only visible to admins with full access.

  3. The request should appear as follows:

    Postman GET request to the loyalty rewards endpoint with a Storename query parameter set to Walmart

    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 TrueLoyal) should be created in advance. To create custom attributes for your store, see Loyalty Custom Attributes.

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

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

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

  1. Click on the "Import" button in Postman to import the API request.

    Postman My Workspace toolbar showing the New and Import buttons

  2. Paste the provided cURL request into the designated box:
    curl -X GET \
      'https://api.zinrelo.com/v2/loyalty/members/john.doe@gmail.com/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.

    To obtain your Partner ID, go to General >> Settings. For the API key, navigate to General >> API Keys and select the API key you created for this purpose.

    Please note: The API Keys section under General is only visible to admins with full access.

  3. The request should appear as follows:

    Postman GET request to the loyalty members rewards endpoint with idParam set to member_id and Storename set to Walmart

    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 TrueLoyal) should be created in advance. To create custom attributes for your store, see Loyalty Custom Attributes.

  4. 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.
  5. Click on the "Send" button in Postman to execute the API request.

If you have any questions or concerns regarding using transaction attributes as filters in APIs to fetch rewards, please don't hesitate to contact Technical Support at support@trueloyal.com.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.