> ## 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 points-earnings summary reports

> Returns total points-earnings statistics for the program (all time), optionally filtered by earning rule or card definition. Each entry sums earning operations for one earning rule, earning item, and card definition. 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.



## OpenAPI

````yaml /openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/points-earnings/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/points-earnings/summary:
    parameters:
      - name: programId
        in: path
        required: true
        description: >-
          Identifies the loyalty program. Format: `lprg_` followed by
          hexadecimal characters.
        schema:
          type: string
          pattern: ^lprg_[a-f0-9]+$
    get:
      tags:
        - Programs
      summary: List program points-earnings summary reports
      description: >-
        Returns total points-earnings statistics for the program (all time),
        optionally filtered by earning rule or card definition. Each entry sums
        earning operations for one earning rule, earning item, and card
        definition. 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.
      operationId: getProgramPointsEarningsSummaryReport
      parameters:
        - name: filters
          in: query
          required: false
          style: deepObject
          explode: true
          description: >-
            Filters rows by earning rule ID and card definition id. Each field
            takes a `conditions` object. Omitting `filters` or setting it to
            `null` applies no field filters.
          schema:
            oneOf:
              - $ref: '#/components/schemas/PointsEarningsReportListFilters'
              - type: 'null'
      responses:
        '200':
          description: Program points-earnings summary report.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody
              examples:
                Program points-earnings summary report:
                  value:
                    data:
                      - id: lppes_132df39de951666c5b
                        earning_rule_id: lern_128f48ee44cc4bec34
                        earning_item_id: lernei_132df28ca59f245b8f
                        card_definition_id: lcdef_128f4a88414c4bed69
                        success_count: 1
                        points: 0
                        pending_points: 150
                        object: program_points_earnings_summary_report
                      - id: lppes_12a92be5da077a3460
                        earning_rule_id: lern_128f48ee44cc4bec34
                        earning_item_id: lernei_128f48ee3fcc4bec33
                        card_definition_id: lcdef_128f4a88414c4bed69
                        success_count: 39
                        points: 0
                        pending_points: 2251295
                        object: program_points_earnings_summary_report
                      - id: lppes_12a92be5b1077a345a
                        earning_rule_id: lern_128f5822398c4bf78f
                        earning_item_id: lernei_128f582238cc4bf78e
                        card_definition_id: lcdef_128f49963c0c4becb7
                        success_count: 40
                        points: 0
                        pending_points: 400
                        object: program_points_earnings_summary_report
                      - id: lppes_12a92be5b0c77a3459
                        earning_rule_id: lern_128f5834b30c4bf7a3
                        earning_item_id: lernei_128f5834b20c4bf7a2
                        card_definition_id: lcdef_128f495f720c4bec8c
                        success_count: 40
                        points: 0
                        pending_points: 400
                        object: program_points_earnings_summary_report
                    object: report
                'Program points-earnings 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-131e4b76ad2e098946
        '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-131e61d450c264502e
                    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-131e61d450c264502f
                    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:
    PointsEarningsReportListFilters:
      type: object
      description: Filters for program points-earnings reports.
      properties:
        junction:
          description: >-
            Combines 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 rows by earning rule ID.
          oneOf:
            - $ref: >-
                #/components/schemas/PointsEarningsReportFilterEarningRuleIdConditions
            - type: 'null'
        card_definition_id:
          description: Filters rows by card definition ID.
          oneOf:
            - $ref: >-
                #/components/schemas/PointsEarningsReportFilterCardDefinitionIdConditions
            - type: 'null'
      additionalProperties: false
    V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody:
      title: V2 Loyalties Programs Reports Points Earnings Summary List Response Body
      type: object
      description: >-
        Response body schema for **GET**
        `/v2/loyalties/programs/{programId}/reports/points-earnings/summary`.
      allOf:
        - $ref: '#/components/schemas/PointsEarningsReportSummaryResponse'
    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.
    PointsEarningsReportFilterEarningRuleIdConditions:
      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 rows whose earning rule ID equals the given value.
              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: >-
                Matches rows whose earning rule ID does not equal the given
                value.
              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 rows whose earning rule ID is one of the given values.
              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: >-
                Matches rows whose earning rule ID is not one of the given
                values.
              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
    PointsEarningsReportFilterCardDefinitionIdConditions:
      type: object
      description: >-
        ID filter conditions for card definition ID. Values must match pattern
        `^lcdef_[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 rows whose card definition id equals the given value.
              oneOf:
                - type: string
                  pattern: ^lcdef_[a-f0-9]+$
                - type: array
                  items:
                    type: string
                    pattern: ^lcdef_[a-f0-9]+$
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $is_not:
              description: >-
                Matches rows whose card definition id does not equal the given
                value.
              oneOf:
                - type: string
                  pattern: ^lcdef_[a-f0-9]+$
                - type: array
                  items:
                    type: string
                    pattern: ^lcdef_[a-f0-9]+$
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $in:
              description: >-
                Matches rows whose card definition id is one of the given
                values.
              oneOf:
                - type: string
                  pattern: ^lcdef_[a-f0-9]+$
                - type: array
                  items:
                    type: string
                    pattern: ^lcdef_[a-f0-9]+$
                  minItems: 1
                  maxItems: 100
                - type: 'null'
            $not_in:
              description: >-
                Matches rows whose card definition id is not one of the given
                values.
              oneOf:
                - type: string
                  pattern: ^lcdef_[a-f0-9]+$
                - type: array
                  items:
                    type: string
                    pattern: ^lcdef_[a-f0-9]+$
                  minItems: 1
                  maxItems: 100
                - type: 'null'
      required:
        - conditions
      additionalProperties: false
    PointsEarningsReportSummaryResponse:
      type: object
      description: Program points-earnings summary report result.
      properties:
        data:
          type: array
          description: >-
            List of summary rows, one per earning rule, earning item, and card
            definition with recorded activity, ordered by `id` descending.
            Contains at most 100 rows. Empty when no activity was recorded.
          items:
            $ref: '#/components/schemas/PointsEarningsReportSummaryEntry'
        object:
          type: string
          const: report
          description: Object type marker. Always `report`.
      required:
        - data
        - object
    PointsEarningsReportSummaryEntry:
      type: object
      description: >-
        Total program points-earnings statistics for one earning rule, earning
        item, and card definition. All numeric fields default to 0.
      properties:
        id:
          type: string
          pattern: ^lppes_[a-f0-9]+$
          description: >-
            Identifies the summary row (format: `lppes_` followed by hexadecimal
            characters).
        earning_rule_id:
          type: string
          pattern: ^lern_[a-f0-9]+$
          description: Identifies the earning rule (format `lern_...`).
        earning_item_id:
          type: string
          pattern: ^lernei_[a-f0-9]+$
          description: >-
            Identifies the earning item that produced the points (format:
            `lernei_` followed by hexadecimal characters).
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: Identifies the card definition (format `lcdef_...`).
        success_count:
          type: number
          description: >-
            Counts earning operations that credited points or added pending
            points.
        points:
          type: number
          description: >-
            Sums points credited immediately by earning rules. Pending points
            activated later are not included.
        pending_points:
          type: number
          description: >-
            Sums pending points added. Activated and canceled pending points are
            not deducted.
        object:
          type: string
          const: program_points_earnings_summary_report
          description: Object type marker. Always `program_points_earnings_summary_report`.
      required:
        - id
        - earning_rule_id
        - earning_item_id
        - card_definition_id
        - success_count
        - points
        - pending_points
        - object
  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.