Get Loyalty Events (GET /v1/loyalty-events)
Retrieves all Loyalty Events with optional filtering and pagination.
URL test:
Method:
GET
Path Items
/v1/loyalty-events
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| accept | header | string | Yes | Media types that are acceptable for the response (e.g., */*). |
| accountid | query | integer (int64) |
No | Filter events by Loyalty Account ID. |
| programid | query | integer (int64) |
No | Filter events by Loyalty Program ID. |
| eventtype | query | string | No | Filter by event type (CUSTOMER_CARD_DISPLAYED, TRANSACTION_ASSESSMENT, CARD_ASSIGNMENT). |
| timestampfrom | query | string (date‑time) | No | Include events with timestamps from this moment (inclusive). |
| timestampto | query | string (date‑time) | No | Include events with timestamps up to this moment (inclusive). |
| page | query | integer (int32) |
No | Zero‑based page index (default 0). |
| size | query | integer (int32) |
No | Number of items per page (default 20). |
| sort | query | string | No | Sorting expression, e.g., timestamp,desc. |
Example cURL
curl -X GET "https://test.lightcms.io/loyalty/v1/loyalty-events?accountid=123&programid=5&page=0&size=20&sort=timestamp,desc" \
-H "accept: */*"
Responses:
200 - OK
Status Code: 200 OK
[
{
"id": 101,
"loyaltyAccountId": 987,
"loyaltyProgramId": 12,
"reward": {
"id": 55,
"rewardType": "LOYALTY_POINTS",
"rewardAmount": 150,
"rewardCurrency": "USD",
"previousRewardAmount": 120,
"customerMessage": "Congratulations! You've earned points.",
"ruleId": 5,
"trancoreId": 2001,
"loyaltyEventId": 101,
"createdAt": "2024-06-01T10:00:00Z",
"updatedAt": "2024-06-01T10:05:00Z"
},
"eventType": "TRANSACTION_ASSESSMENT",
"eventDetails": {},
"timestamp": "2024-06-01T10:00:00Z",
"createdAt": "2024-06-01T10:00:00Z",
"updatedAt": "2024-06-01T10:05:00Z"
}
]
| Parameter | Location | Type | Description |
|---|---|---|---|
| id | body | integer (int64) |
Unique identifier of the Loyalty Event. |
| loyaltyAccountId | body | integer (int64) |
Identifier of the Loyalty Account linked to the event. |
| loyaltyProgramId | body | integer (int64) |
Identifier of the Loyalty Program linked to the event. |
| reward.id | body | integer (int64) |
Identifier of the Reward associated with the event. |
| reward.rewardType | body | string | Type of reward (PERCENTAGE, FLAT_AMOUNT, LOYALTY_POINTS). |
| reward.rewardAmount | body | number | Monetary or point value of the reward. |
| reward.rewardCurrency | body | string | Currency code for monetary rewards (e.g., USD). |
| reward.previousRewardAmount | body | number | Reward amount before the current update (if applicable). |
| reward.customerMessage | body | string | Message shown to the customer regarding the reward. |
| reward.ruleId | body | integer (int64) |
Identifier of the rule that generated the reward. |
| reward.trancoreId | body | integer (int64) |
Transaction ID in Trancore associated with the reward. |
| reward.loyaltyEventId | body | integer (int64) |
Identifier of the Loyalty Event that produced the reward (mirrors the outer id). |
| reward.createdAt | body | string (date‑time) | Timestamp when the Reward record was created. |
| reward.updatedAt | body | string (date‑time) | Timestamp of the last update to the Reward record. |
| eventType | body | string | Type of the event (CUSTOMER_CARD_DISPLAYED, TRANSACTION_ASSESSMENT, CARD_ASSIGNMENT). |
| eventDetails | body | object (JsonNode) | Additional details specific to the event type. |
| timestamp | body | string (date‑time) | Exact time the event occurred. |
| createdAt | body | string (date‑time) | Timestamp when the Loyalty Event record was created. |
| updatedAt | body | string (date‑time) | Timestamp of the last modification to the Loyalty Event record. |