Skip to content

Get Rewards (GET /v1/rewards)

Retrieves all rewards with optional filtering and pagination.

URL test:

https://test.lightcms.io/loyalty/v1/rewards

Method:

GET

Path Items

/v1/rewards

Parameters

Name Location Type Required Description
accountId query integer (int64) No Filter rewards by Loyalty Account ID.
dateFrom query string (date‑time) No Include rewards created from this timestamp (inclusive).
dateTo query string (date‑time) No Include rewards created up to this timestamp (inclusive).
trancoreId query integer (int64) No Filter rewards by transaction (Trancore) ID.
ruleId query integer (int64) No Filter rewards by the rule that generated them.
rewardType query string No Filter by reward type (PERCENTAGE, FLAT_AMOUNT, LOYALTY_POINTS).
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 acceptable for the response (e.g., */*).

Example cURL

    curl -X GET "https://test.lightcms.io/loyalty/v1/rewards?accountId=123&page=0&size=20&sort=createdAt,desc" \
         -H "accept: */*"

Responses:

200 - OK

Status Code: 200 OK

[
  {
    "id": 101,
    "rewardType": "LOYALTY_POINTS",
    "rewardAmount": 150,
    "rewardCurrency": "USD",
    "previousRewardAmount": 120,
    "customerMessage": "Congratulations! You've earned points.",
    "ruleId": 5,
    "trancoreId": 2001,
    "loyaltyEventId": 301,
    "loyaltyAccountId": 987,
    "createdAt": "2024-06-01T10:00:00Z",
    "updatedAt": "2024-06-01T10:05:00Z"
  }
]

Parameter Location Type Description
id body integer (int64) Unique identifier of the reward record.
rewardType body string Type of reward (PERCENTAGE, FLAT_AMOUNT, LOYALTY_POINTS).
rewardAmount body number Monetary or point value of the reward granted.
rewardCurrency body string Currency code for monetary rewards (e.g., USD).
previousRewardAmount body number Reward amount before the current update (if applicable).
customerMessage body string Message shown to the customer regarding the reward.
ruleId body integer (int64) Identifier of the rule that generated the reward.
trancoreId body integer (int64) Transaction ID in Trancore associated with the reward.
loyaltyEventId body integer (int64) Identifier of the Loyalty Event that produced the reward.
loyaltyAccountId body integer (int64) Identifier of the Loyalty Account receiving the reward.
createdAt body string (date‑time) Timestamp when the reward record was created.
updatedAt body string (date‑time) Timestamp of the last update to the reward record.
500 - Internal Server Error

Status Code: 500 Internal Server Error

{
  "errorMessage": "Internal error"
}