Customer Transactions

You can use the transactions API to view customer transactions in LoyaltyLion.

A transaction denotes a single change to a customer's point value.
FieldTypeDescription
idintegerUnique ID of the transaction in LoyaltyLion
customerobjectAn object containing the linked customer’s ID and other fields
resourcestringThe type of resource associated with this transaction: one of activity, adjustment, claimed_reward, expiry
points_approvedintegerNumber of approved points (added or removed)
points_pendingintegerNumber of pending points (added or removed)
created_atstringAn ISO 8601 timestamp representing when this transaction occurred in LoyaltyLion
activityobject or nullWhen the resource type is activity, this contains information about the related activity
claimed_rewardobject or nullWhen the resource type is claimed_reward, this contains information about the related reward
adjustmentobject or nullWhen the resource type is adjustment, this contains information about the related point adjustment
expiryobject or nullWhen the resource type is expiry, this contains information about the related point expiry

Customer

The attached customer includes fields describing the current state of the customer. Not as they were at the time of the transaction.

FieldTypeDescription
idintegerUnique ID of the customer in LoyaltyLion
merchant_idstringUnique ID of the customer in your store
emailstring or nullEmail address of the customer
points_pendingintegerNumber of approved points
points_approvedintegerNumber of approved points
points_spentintegerNumber of pending points

As noted above, transactions can have differing resource types. Each of these resource types contains a set of fields describing it.

Please note that all sub-resources that are associated with a transaction are presented as they are now. Not as they were at the time of the transaction.

Activity resource

When the transaction has a resource of activity, the top level activity node contains information about the associated activity. The fields can be seen in our activity API documentation.

Alongside these fields, we also include the following:

FieldTypeDescription
resourcestring or nullSome activities can have related resources such as orders. This field indicates the type of the related resource
orderobject or nullWhen the resource type is order, this contains information about the related order

Claimed reward resource

When the transaction has a resource of claimed_reward, the top level claimed_reward node contains information about the associated reward and associated redeemable. The fields can be seen in our rewards API documentation.

Adjustment resource

When the transaction has a resource of adjustment, the top level adjustment node contains information about the associated manual point adjustment.

FieldTypeDescription
notestring or nullThe customer-visible message that was added at the time of the manual point adjustment

Expiry resource

When the transaction has a resource of expiry, the top level expiry node contains information about the associated point expiry.

FieldTypeDescription
notestring or nullThe customer-visible message that was added at the time of the point expiry

GET /v2/transactions

Returns a pageable list of all point transactions in your program, by default sorted newest first.

Request

You can pass the following optional query parameters with the request.

ParamDescription
since_idOnly return transactions that have IDs greater than the provided ID
cursorA cursor to retrieve another page of results. Cursor pagination guidance

Response

This endpoint returns a list of point transactions.

Example

curl -X GET \
  --url 'https://api.loyaltylion.com/v2/customers/1001/transactions' \
  --header 'Content-Type: application/json' \

GET /v2/customers/:merchant_id/transactions

Returns a pageable list of a customer’s point transactions.

The :merchant_id provided should match your own internal ID (from your ecommerce platform) for this customer in your database.

Request

You can pass the following optional query parameters with the request.

ParamDescription
since_idOnly return transactions that have IDs greater than the provided ID
cursorA cursor to retrieve another page of results. Cursor pagination guidance

Response

This endpoint returns a list of transactions.

Example

curl -X GET \
  --url 'https://api.loyaltylion.com/v2/customers/1001/transactions' \
  --header 'Content-Type: application/json' \