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

# List program earning-rules summary reports

> Returns total earning-rule evaluation statistics for the program (all time), optionally filtered by earning rule. Includes success and failure counts with a failures breakdown. Each entry counts eligibility checks for one earning rule. Returns at most 100 rows, ordered by `id` descending. `limit` and `order` are not query parameters. A filter that matches no rows returns an empty `data` array.

Returns `400` when query validation fails. Returns `404` when the program does not exist.

A successful call records no activity.



## OpenAPI

````yaml /openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/earning-rules/summary
openapi: 3.1.0
info:
  title: Voucherify API - Loyalty v2
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v2/loyalties/programs/{programId}/reports/earning-rules/summary:
    parameters:
      - name: programId
        in: path
        required: true
        description: Identifies the loyalty program. Format `lprg_[a-f0-9]+`.
        schema:
          type: string
          pattern: ^lprg_[a-f0-9]+$
    get:
      tags:
        - Programs
      summary: List program earning-rules summary reports
      description: >-
        Returns total earning-rule evaluation statistics for the program (all
        time), optionally filtered by earning rule. Includes success and failure
        counts with a failures breakdown. Each entry counts eligibility checks
        for one earning rule. Returns at most 100 rows, ordered by `id`
        descending. `limit` and `order` are not query parameters. A filter that
        matches no rows returns an empty `data` array.


        Returns `400` when query validation fails. Returns `404` when the
        program does not exist.


        A successful call records no activity.
      operationId: listProgramEarningRulesSummaryReports
      parameters:
        - name: filters
          in: query
          required: false
          style: deepObject
          explode: true
          description: >-
            Filters the results. Pass a deep object, for example
            `filters[earning_rule_id][conditions][$is]=lern_...`. Fields combine
            through `junction`, which defaults to `AND`. Omit `filters` to apply
            no field filter.
          schema:
            $ref: '#/components/schemas/EarningRulesReportListFilters'
      responses:
        '200':
          description: Program earning-rules summary report.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody
              examples:
                Program earning-rules summary report:
                  value:
                    data:
                      - id: lpers_12f8c3cb8fdaa184cd
                        earning_rule_id: lern_128f57ec40cc4bf762
                        success_count: 3
                        failures_count: 0
                        failures_breakdown:
                          COOLDOWN: 0
                          FREQUENCY: 0
                        object: program_earning_rules_summary_report
                      - id: lpers_12a92be41e477a33d8
                        earning_rule_id: lern_128f5834b30c4bf7a3
                        success_count: 40
                        failures_count: 0
                        failures_breakdown:
                          COOLDOWN: 0
                          FREQUENCY: 0
                        object: program_earning_rules_summary_report
                      - id: lpers_12a92be41b077a33d1
                        earning_rule_id: lern_128f5822398c4bf78f
                        success_count: 40
                        failures_count: 0
                        failures_breakdown:
                          COOLDOWN: 0
                          FREQUENCY: 0
                        object: program_earning_rules_summary_report
                      - id: lpers_12a92be418877a33ca
                        earning_rule_id: lern_128f48ee44cc4bec34
                        success_count: 40
                        failures_count: 0
                        failures_breakdown:
                          COOLDOWN: 0
                          FREQUENCY: 0
                        object: program_earning_rules_summary_report
                    object: report
                'Program earning-rules summary report: Cooldown failure':
                  value:
                    data:
                      - id: lpers_12c2bc3be20c8cb534
                        earning_rule_id: lern_128f9ee63cc4ba558
                        success_count: 0
                        failures_count: 1
                        failures_breakdown:
                          COOLDOWN: 1
                        object: program_earning_rules_summary_report
                    object: report
                'Program earning-rules summary report: No activity':
                  value:
                    data: []
                    object: report
        '400':
          description: Query parameters failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                'Invalid query parameters: `earning_rule_id` is invalid':
                  value:
                    code: 400
                    key: invalid_query_params
                    message: Invalid query params
                    details: >-
                      Property .filters.earning_rule_id.conditions.$is must
                      match pattern "^lern_[a-f0-9]+$"
                    request_id: v-131e4b76ad2e098947
        '404':
          description: The program does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Program not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find program with id lprg_28f58429f4c4bf7b2
                    request_id: v-131e61d450c264502f
                    resource_id: lprg_28f58429f4c4bf7b2
                    resource_type: program
                Program id does not match the pattern:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find program with id missing
                    request_id: v-131e61d450c2645030
                    resource_id: missing
                    resource_type: program
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Internal server error:
                  value:
                    code: 500
                    key: api_error
                    message: >-
                      Something went wrong. Don't worry, your campaigns are
                      still safe and the Voucherify Team has been notified.
                      Check out our Help Center and forums for help, or head
                      back to home.
      security:
        - X-App-Id: []
          X-App-Token: []
        - bearerAuth: []
components:
  schemas:
    EarningRulesReportListFilters:
      type: object
      description: Filters for program earning-rules reports.
      properties:
        junction:
          description: >-
            Joins the field filters. Allowed values are `AND` and `OR`. Defaults
            to `AND`.
          oneOf:
            - type: string
              enum:
                - AND
                - OR
            - type: 'null'
        earning_rule_id:
          description: Filters by earning rule ID. Format `lern_[a-f0-9]+`.
          oneOf:
            - $ref: '#/components/schemas/EarningRuleIdFilterConditions'
            - type: 'null'
      additionalProperties: false
    V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody:
      title: V2 Loyalties Programs Reports Earning Rules Summary List Response Body
      type: object
      description: >-
        Response body schema for **GET**
        `/v2/loyalties/programs/{programId}/reports/earning-rules/summary`.
      allOf:
        - $ref: '#/components/schemas/EarningRulesReportSummaryResponse'
    ErrorResponse:
      type: object
      description: Standard error response returned by all Loyalty v2 endpoints.
      properties:
        code:
          type: integer
          description: HTTP status code of the error.
        key:
          type: string
          description: Machine-readable error key.
        message:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Additional details about the error.
        request_id:
          type: string
          description: Unique identifier of the request that produced the error.
        resource_id:
          type: string
          description: Unique identifier of the resource that produced the error.
        resource_type:
          type: string
          description: Type of the resource that produced the error.
    EarningRuleIdFilterConditions:
      type: object
      description: >-
        ID filter conditions for earning rule ID. Values must match pattern
        `^lern_[a-f0-9]+$`. `$is`/`$is_not` accept a single value (string or
        1-element array); `$in`/`$not_in` accept a string or an array of 1-100
        values.
      properties:
        conditions:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            $is:
              description: >-
                Matches one value. A string or a one-element array. Format
                `lern_[a-f0-9]+`.
              oneOf:
                - type: string
                  pattern: ^lern_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    pattern: ^lern_[a-f0-9]+$
                - type: 'null'
            $is_not:
              description: >-
                Excludes one value. A string or a one-element array. Format
                `lern_[a-f0-9]+`.
              oneOf:
                - type: string
                  pattern: ^lern_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    pattern: ^lern_[a-f0-9]+$
                - type: 'null'
            $in:
              description: >-
                Matches any of the values. A string or an array of 1 to 100
                values. Format `lern_[a-f0-9]+`.
              oneOf:
                - type: string
                  pattern: ^lern_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^lern_[a-f0-9]+$
                - type: 'null'
            $not_in:
              description: >-
                Excludes any of the values. A string or an array of 1 to 100
                values. Format `lern_[a-f0-9]+`.
              oneOf:
                - type: string
                  pattern: ^lern_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^lern_[a-f0-9]+$
                - type: 'null'
      required:
        - conditions
      additionalProperties: false
    EarningRulesReportSummaryResponse:
      type: object
      description: Program earning-rules summary report result.
      properties:
        data:
          type: array
          description: >-
            List of summary rows, one per earning rule with recorded activity,
            ordered by `id` descending. Contains at most 100 rows. Empty when no
            activity was recorded.
          items:
            $ref: '#/components/schemas/EarningRulesReportSummaryEntry'
        object:
          type: string
          const: report
          description: Object type marker. Always `report`.
      required:
        - data
        - object
    EarningRulesReportSummaryEntry:
      type: object
      description: >-
        Total program earning-rule evaluation statistics for one earning rule.
        All numeric fields default to 0.
      properties:
        id:
          type: string
          pattern: ^lpers_[a-f0-9]+$
          description: >-
            Identifies the summary row (format: `lpers_` followed by hexadecimal
            characters).
        earning_rule_id:
          type: string
          pattern: ^lern_[a-f0-9]+$
          description: Identifies the earning rule (format `lern_...`).
        success_count:
          type: number
          description: Counts eligibility checks that passed the trigger limit.
        failures_count:
          type: number
          description: Counts eligibility checks that failed the trigger limit.
        failures_breakdown:
          $ref: '#/components/schemas/EarningRulesReportFailuresBreakdown'
          description: >-
            Counts failed trigger-limit checks by reason. Either key may be
            absent or `0`. The object is empty when no failure counts are stored
            yet.
        object:
          type: string
          const: program_earning_rules_summary_report
          description: Object type marker. Always `program_earning_rules_summary_report`.
      required:
        - id
        - earning_rule_id
        - success_count
        - failures_count
        - failures_breakdown
        - object
    EarningRulesReportFailuresBreakdown:
      description: >-
        Counts failed trigger-limit checks by reason. `COOLDOWN` and `FREQUENCY`
        are the only keys. Either key may be absent. A present key is `0` when
        that reason has no failures. The object is empty when no failure counts
        are stored yet.
      allOf:
        - $ref: '#/components/schemas/ReportLimitFailureCountBase'
      unevaluatedProperties: false
    ReportLimitFailureCountBase:
      type: object
      properties:
        COOLDOWN:
          type: number
          description: Counts failures caused by the cooldown limit.
        FREQUENCY:
          type: number
          description: Counts failures caused by the frequency limit.
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.