Customer Transactions
You can use the transactions API to view customer transactions in LoyaltyLion.
Field | Type | Description |
---|---|---|
id | integer | Unique ID of the transaction in LoyaltyLion |
customer | object | An object containing the linked customer’s ID and other fields |
resource | string | The type of resource associated with this transaction: one of activity , adjustment , claimed_reward , expiry |
points_approved | integer | Number of approved points (added or removed) |
points_pending | integer | Number of pending points (added or removed) |
created_at | string | An ISO 8601 timestamp representing when this transaction occurred in LoyaltyLion |
activity | object or null | When the resource type is activity , this contains information about the related activity |
claimed_reward | object or null | When the resource type is claimed_reward , this contains information about the related reward |
adjustment | object or null | When the resource type is adjustment , this contains information about the related point adjustment |
expiry | object or null | When 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.
Field | Type | Description |
---|---|---|
id | integer | Unique ID of the customer in LoyaltyLion |
merchant_id | string | Unique ID of the customer in your store |
string or null | Email address of the customer | |
points_pending | integer | Number of approved points |
points_approved | integer | Number of approved points |
points_spent | integer | Number of pending points |
As noted above, transactions can have differing resource types. Each of these resource types contains a set of fields describing it.
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:
Field | Type | Description |
---|---|---|
resource | string or null | Some activities can have related resources such as orders. This field indicates the type of the related resource |
order | object or null | When 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.
Field | Type | Description |
---|---|---|
note | string or null | The 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.
Field | Type | Description |
---|---|---|
note | string or null | The 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.
Param | Description |
---|---|
since_id | Only return transactions that have IDs greater than the provided ID |
cursor | A 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.
Param | Description |
---|---|
since_id | Only return transactions that have IDs greater than the provided ID |
cursor | A 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' \