Customer Transactions

GET /v2/customers/:merchant_id/transactions

A transaction denotes a single change to a customer's point value.

Returns a pageable list of a customer’s transactions.

The :merchant_id provided should match your own internal ID 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

Response

This endpoint returns a list of transactions.

FieldTypeDescription
idintegerUnique ID of the transaction in LoyaltyLion
customerobjectAn object containing the linked customer’s ID and other fields
resourcestringDescriber field for the type of transaction '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 | nullWhen the resource type is activity, this contains information about the related activity
claimed_rewardobject | nullWhen the resource type is claimed_reward, this contains information about the related reward
adjustmentobject | nullWhen the resource type is adjustment, this contains information about the related point adjustment
expiryobject | 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 | 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 | nullSome activities can have related resources such as orders. This field indicates the type of the related resource
orderobject | 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 | 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 | nullThe customer-visible message that was added at the time of the point expiry

Example

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