Skip to main content
GET
/
v1
/
earning-rules
List earning rules
curl --request GET \
  --url https://api.mageloyalty.com/v1/earning-rules \
  --header 'Authorization: <api-key>'
List all earning rules for the shop.

Query parameters

ParameterTypeDescription
filter[is_active]stringFilter by active status: true or false
sortstringSort field. Prefix with - for descending. Options: created_at, name. Default: -created_at
page[number]integerPage number (default: 1)
page[size]integerResults per page (default: 20, max: 100)

Response

{
  "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
  }
}