Skip to content

Get Loyalty Program Accounts (GET /v1/loyalty-programs/{id}/accounts)

Retrieves all Loyalty Accounts that belong to a specific Loyalty Program.

URL test:

https://test.lightcms.io/loyalty/v1/loyalty-programs/{id}/accounts

Method:

GET

Path Items

/v1/loyalty-programs/{id}/accounts

Parameters

Name Location Type Required Description
id path integer (int64) Yes Identifier of the Loyalty Program (must be > 0).
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., id,desc.
accept header string Yes Media types acceptable for the response (e.g., */*).

Example cURL

    curl -X GET "https://test.lightcms.io/loyalty/v1/loyalty-programs/12/accounts?page=0&size=20&sort=id,desc" \
         -H "accept: */*"

Responses:

200 - OK

Status Code: 200 OK

[
  {
    "id": 987,
    "loyaltyProgramId": 12,
    "cardId": 345,
    "accountId": 678,
    "holderId": "holder-abc-123",
    "holderFirstName": "Jane",
    "holderSurname": "Doe",
    "totalRewards": 1500.75,
    "totalRewardsCurrency": "USD",
    "createdAt": "2024-05-10T14:30:00Z",
    "updatedAt": "2025-01-22T09:15:00Z"
  },
  {
    "id": 988,
    "loyaltyProgramId": 12,
    "cardId": 346,
    "accountId": 679,
    "holderId": "holder-def-456",
    "holderFirstName": "John",
    "holderSurname": "Smith",
    "totalRewards": 300,
    "totalRewardsCurrency": "EUR",
    "createdAt": "2024-06-01T08:20:00Z",
    "updatedAt": "2025-02-10T11: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 (matches the path id).
cardId body integer (int64) Identifier of the associated Card.
accountId body integer (int64) External account identifier.
holderId body string External identifier of the account holder.
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-04T12:16:34.897159276",
"status": 404,
"error": "Resource Not Found",
"message": "Loyalty program not found with id: 12121212"
}

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.