Skip to content

Get Loyalty Rule (GET /v1/loyalty-programs/{programId}/rules/{ruleId})

Retrieves the details of a specific rule within a Loyalty Program.

URL test:

https://test.lightcms.io/loyalty/v1/loyalty-programs/{programId}/rules/{ruleId}

Method:

GET

Path Items

/v1/loyalty-programs/{programId}/rules/{ruleId}

Parameters

Name Location Type Required Description
programId path integer (int64) Yes Identifier of the Loyalty Program (must be > 0).
ruleId path integer (int64) Yes Identifier of the rule within the program (must be > 0).

Example cURL

    curl -X GET "https://test.lightcms.io/loyalty/v1/loyalty-programs/12/rules/5" \
         -H "accept: */*"

Responses:

200 - OK

Status Code: 200 OK

{
  "id": 5,
  "seqNo": 1,
  "enabled": true,
  "definition": {
    "name": "Sample Rule",
    "condition": {
      "type": "MERCHANT_NAME",
      "params": {
        "additionalProp1": "value1",
        "additionalProp2": "value2",
        "additionalProp3": "value3"
      }
    },
    "onTrue": {
      "type": "GRANT_REWARD",
      "params": {
        "additionalProp1": "valA",
        "additionalProp2": "valB",
        "additionalProp3": "valC"
      }
    },
    "onFalse": {
      "type": "NO_ACTION",
      "params": {
        "additionalProp1": "none1",
        "additionalProp2": "none2",
        "additionalProp3": "none3"
      }
    }
  },
  "outcomeOnTrue": "GO_TO_NEXT_RULE",
  "outcomeOnFalse": "STOP_EVALUATION",
  "customerMessageOnTrue": "Rule passed – reward granted.",
  "customerMessageOnFalse": "Rule failed – no reward.",
  "validityFrom": "2024-01-01",
  "validityTo": "2025-12-31"
}

Parameter Location Type Description
id body integer (int64) Unique identifier of the rule.
seqNo body integer (int64) Sequence number determining rule order.
enabled body boolean Indicates whether the rule is active.
definition.name body.definition string Human‑readable name of the rule.
definition.condition.type body.definition.condition string Type of the condition (e.g., MERCHANT_NAME).
definition.condition.params.additionalProp1 body.definition.condition.params string First custom parameter for the condition.
definition.condition.params.additionalProp2 body.definition.condition.params string Second custom parameter for the condition.
definition.condition.params.additionalProp3 body.definition.condition.params string Third custom parameter for the condition.
definition.onTrue.type body.definition.onTrue string Action type when the condition evaluates to true.
definition.onTrue.params.additionalProp1 body.definition.onTrue.params string First custom parameter for the true outcome.
definition.onTrue.params.additionalProp2 body.definition.onTrue.params string Second custom parameter for the true outcome.
definition.onTrue.params.additionalProp3 body.definition.onTrue.params string Third custom parameter for the true outcome.
definition.onFalse.type body.definition.onFalse string Action type when the condition evaluates to false.
definition.onFalse.params.additionalProp1 body.definition.onFalse.params string First custom parameter for the false outcome.
definition.onFalse.params.additionalProp2 body.definition.onFalse.params string Second custom parameter for the false outcome.
definition.onFalse.params.additionalProp3 body.definition.onFalse.params string Third custom parameter for the false outcome.
outcomeOnTrue body string What to do after a true evaluation (GO_TO_NEXT_RULE or STOP_EVALUATION).
outcomeOnFalse body string What to do after a false evaluation (GO_TO_NEXT_RULE or STOP_EVALUATION).
customerMessageOnTrue body string Message shown to the customer when the rule passes.
customerMessageOnFalse body string Message shown to the customer when the rule fails.
validityFrom body string (date) Start date of rule validity.
validityTo body string (date) End date of rule validity.
404 - Not Found - Loyalty Program

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.
404 - Not Found - Loyalty Program

Status Code: 404 Not Found

{
"timestamp": "2026-02-04T12:18:17.917097675",
"status": 404,
"error": "Resource Not Found",
"message": "Loyalty rule 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.