> ## Documentation Index
> Fetch the complete documentation index at: https://developers.mageloyalty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List earning rules

> List all earning rules for the shop.

List all earning rules for the shop.

## Query parameters

| Parameter           | Type    | Description                                                                                       |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| `filter[is_active]` | string  | Filter by active status: `true` or `false`                                                        |
| `sort`              | string  | Sort field. Prefix with `-` for descending. Options: `created_at`, `name`. Default: `-created_at` |
| `page[number]`      | integer | Page number (default: `1`)                                                                        |
| `page[size]`        | integer | Results per page (default: `20`, max: `100`)                                                      |

## Response

```json theme={null}
{
  "data": [
    {
      "type": "earning_rule",
      "id": "rule_abc",
      "attributes": {
        "name": "Points for purchase",
        "description": null,
        "action": "place_order",
        "category": "purchase",
        "is_active": true,
        "points_to_give": 10,
        "customer_facing_label": "Earn 10 points per £1 spent",
        "call_to_action_url": null,
        "created_at": "2024-01-01T00:00:00.000Z",
        "updated_at": "2024-01-01T00:00:00.000Z"
      }
    }
  ],
  "meta": {
    "total": 5,
    "page": 1,
    "per_page": 20,
    "total_pages": 1
  }
}
```
