Get Loyalty Accounts By Holder (GET /v1/loyalty-accounts/holder/{holderId})
Retrieves all Loyalty Accounts belonging to a specific holder.
URL test:
Method:
GET
Path Items
/v1/loyalty-accounts/holder/{holderId}
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| holderId | path | string | Yes | Identifier of the holder whose accounts are being retrieved. |
| 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., createdAt,desc. |
| accept | header | string | Yes | Media types that are acceptable for the response (e.g., */*). |
Example cURL
curl -X GET "https://test.lightcms.io/loyalty/v1/loyalty-accounts/holder/ABC123?page=0&size=20&sort=createdAt,desc" \
-H "accept: */*"
Responses:
200 - OK
Status Code: 200 OK
[
{
"id": 987,
"loyaltyProgramId": 12,
"cardId": 345,
"accountId": 678,
"holderId": "ABC123",
"holderFirstName": "Jane",
"holderSurname": "Doe",
"totalRewards": 1500.75,
"totalRewardsCurrency": "USD",
"createdAt": "2024-05-10T14:30:00Z",
"updatedAt": "2025-01-22T09:15:00Z"
},
{
"id": 988,
"loyaltyProgramId": 13,
"cardId": 346,
"accountId": 679,
"holderId": "ABC123",
"holderFirstName": "Jane",
"holderSurname": "Doe",
"totalRewards": 300.00,
"totalRewardsCurrency": "USD",
"createdAt": "2024-06-15T11:00:00Z",
"updatedAt": "2025-02-05T08:45:00Z"
}
]
| Parameter | Location | Type | Description |
|---|---|---|---|
| id | body | integer (int64) |
Unique identifier of the Loyalty Account. |
| loyaltyProgramId | body | integer (int64) |
Identifier of the Loyalty Program the account belongs to. |
| cardId | body | integer (int64) |
Identifier of the associated Card. |
| accountId | body | integer (int64) |
External account identifier. |
| holderId | body | string | Identifier of the holder (matches the path parameter). |
| holderFirstName | body | string | First name of the holder. |
| holderSurname | body | string | Surname of the holder. |
| totalRewards | body | number | Accumulated reward amount for the account. |
| totalRewardsCurrency | body | string | Currency code for the total rewards (e.g., USD). |
| createdAt | body | string (date‑time) | Timestamp when the Loyalty Account was created. |
| updatedAt | body | string (date‑time) | Timestamp of the last update to the Loyalty Account. |
404 - Not Found
Status Code: 404 Not Found
{
"timestamp": "2026-02-03T17:09:02.825396155",
"status": 404,
"error": "Resource Not Found",
"message": "Loyalty account not found with id: 2"
}
| Parameter | Location | Type | Description |
|---|---|---|---|
| timestamp | body | string (date‑time) | Time when the error response was generated. |
| status | body | integer | HTTP status code (404). |
| error | body | string | Short error label (“Resource Not Found”). |
| message | body | string | Detailed error message indicating the missing ID. |