Skip to main content

Display loyalty transactions in Shopify 

In this tutorial, you'll learn how to collect the data needed to display a customer's loyalty points history in your Shopify store.

This tutorial explains how to collect the data. For each loyalty point transaction, you retrieve the name and ID of the order that caused it. How you display it in your store depends on your theme or storefront.

Talon.One requirements​

Shopify requirements​

With this setup, attributes.order_name and attributes.order_id are available in Talon.One's customer session data.

Collect the transaction data​

1

Create an Integration API key​

Both endpoints used in this tutorial require an Integration API key. To create one:

  1. In your Application, click Settings > Integration API Keys.

  2. Click Create API Key.

  3. In the Create API Key drawer, if you are asked for a key type, select Production.

  4. In Key name, type a name to identify the key.

  5. In Key expiration date, select a date.

    Tip

    Avoid choosing expiration dates that fall at the end of the year or during other high-traffic periods.

  6. In Third-party integration, select No.

  7. Click Create API Key.

  8. Click to copy the key for use.

Note

You cannot view or copy the API key after closing the drawer.

2

List the customer's loyalty transactions​

Call the List customer's loyalty transactions endpoint to retrieve the loyalty transactions of the customer.

3

Look up the session ID of each transaction​

Each transaction in the response contains a customerSessionID property. This is the ID of the customer session that triggered the transaction.

4

Get the customer session​

For each session ID, call the Get customer session endpoint.

5

Get the order details​

In the response, get the following values from the attributes object:

  • order_name: The customer-facing order reference in Shopify, for example, #1001.
  • order_id: The unique numeric order identifier in Shopify, for example, 5487236912345.

You can now combine each transaction with its order name and ID to display a loyalty points history to your customers in your store. For example:

Loyalty points history in the customer account of a Shopify store.