---
title: "List earning rules"
method: GET
path: "/earning_rules"
tags: ["Earning Rules"]
---

# List earning rules

`GET /earning_rules`

Retrieves a list of enabled earning rules.

## Query parameters

- `limit` integer — The maximum number of earning rules to retrieve.
- `cursor` string — Cursor for the page of earning rules to retrieve.

## Response `200`

- object
  - `earning_rules` EarningRule[]
    - `id` integer — Unique identifier for the earning rule.
    - `name` string — The display name of the earning rule.
    - `image_url` string — The image of the earning rule.
    - `action_text` string, nullable — The label for a clickable element (e.g. a call to action) that allows the customer to complete the rewardable action. When `null`, no clickable element should be displayed.
    - `action_url` string, nullable — The destination URL for a clickable element (e.g. a call to action) that allows the customer to complete the rewardable action. When `null`, no clickable element should be displayed.
    - `restricted_to_vip_tier_ids` integer[] — A list of VIP tier IDs. When present, the earning rule only applies to customers who currently belong to at least one of the specified VIP tiers. If the array is empty, the earning rule applies to all VIP tiers.
    - `reward` object — The reward that will be issued to the customer when the rewardable action is completed.
      - `type` 'points' — The type of reward that will be issued.
    - `reward_value` object — The value of the reward that will be issued to the customer when the rewardable action is completed.
      - `type` 'variable' | 'fixed' — The way that the reward's value will be computed.
      - `variable` object — The configuration for a variable reward value (e.g. points per dollar spent). Only present when type is `variable`, otherwise this key will be omitted from response.
        - `value` number, float — The amount of reward value issued per unit (e.g. if the reward is 5 Points per $1 spent, this field would be `5.0`).
        - `per_amount` number, float — The amount of action needed to earn the specified value (e.g. if the reward is 5 Points per $1 spent, this field would be `1.0`).
      - `fixed` object — The configuration for a fixed reward value (e.g. 5 points). Only present when type is `fixed`, otherwise this key will be omitted from response.
        - `value` number, float — The value of the reward that will be issued.
    - `earning_limit` object, nullable — A restriction on the number of times the rewardable action can be completed. If no limit exists, will be `null`.
      - `max` integer — Maximum number of times a customer can complete the rule within the specified timeframe.
      - `type` 'rolling' | 'lifetime' — The type of timeframe the limit applies to.
      - `rolling` object — The configuration for a rolling window of time. Only present when type is `rolling`, otherwise this key will be omitted from response.
        - `unit` 'day' — The rolling window's unit (e.g. if the window is 30 days, this field will have a value of `day`).
        - `unit_count` integer — The number of units in the rolling window (e.g. if the window is 30 days, this field will have a value of `30`).
  - `metadata` PaginationMetadata
    - `next_cursor` string, nullable — A cursor value that when present, can be used to retrieve the next page of results.
    - `previous_cursor` string, nullable — A cursor value that when present, can be used to retrieve the previous page of results.

---

[API](https://skmtc.dev/smile/apis/smile-io-rest-api.md) · [All operations](https://skmtc.dev/smile/apis/smile-io-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smile/smile-io-rest-api/revisions/081bc804c5df/schema)
