> ## 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 rule assignments

> Returns a cursor-paginated list of earning rules assigned to the program.

A successful call records no activity.



## OpenAPI

````yaml /openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/earning-rules
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}/earning-rules:
    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 rule assignments
      description: >-
        Returns a cursor-paginated list of earning rules assigned to the
        program.


        A successful call records no activity.
      operationId: listProgramEarningRuleAssignments
      parameters:
        - name: limit
          in: query
          required: false
          description: >-
            Limits the page size to an integer from 1 to 100. Defaults to 10. A
            numeric string is accepted and rounded to the nearest integer.
          schema:
            type:
              - number
              - string
              - 'null'
            minimum: 1
            maximum: 100
            default: 10
        - name: order
          in: query
          required: false
          description: >-
            Orders the results. Accepts one value or an array. Prefix a field
            with `-` for descending order. Defaults to `-created_at`. The same
            field cannot be used in both directions. Rows with the same sort
            value are then ordered by `id` ascending.
          schema:
            oneOf:
              - type: array
                items:
                  type: string
                  enum:
                    - '-created_at'
                    - created_at
              - type: string
                enum:
                  - '-created_at'
                  - created_at
              - type: 'null'
        - name: cursor
          in: query
          required: false
          description: >-
            Continues pagination. Pass the `cursor.next` value from a previous
            response. Format `lcrserna_[a-f0-9]+`. The cursor matches the
            filters and order of that response.
          schema:
            type:
              - string
              - 'null'
            pattern: ^lcrserna_[a-f0-9]+$
      responses:
        '200':
          description: Paginated list of earning rule assignments.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/V2LoyaltiesProgramsEarningRulesListResponseBody
              examples:
                List of earning rules with a cursor:
                  value:
                    data:
                      - earning_rule_id: lern_12cd26a685db3e63d8
                        created_at: '2026-07-29T11:38:14.731Z'
                        object: program_earning_rule
                      - earning_rule_id: lern_128f48ee44cc4bec34
                        created_at: '2026-06-11T15:57:31.791Z'
                        object: program_earning_rule
                      - earning_rule_id: lern_128f577bd4d47c8e12
                        created_at: '2026-06-11T15:57:29.977Z'
                        object: program_earning_rule
                    cursor:
                      next: lcrserna_131f92cb9e16d68013
                      expires_at: '2026-10-01T12:16:10.809Z'
                    object: list
        '400':
          description: >-
            Query parameters failed validation, or the cursor is invalid,
            expired, from another list, or does not match this query.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Invalid cursor format:
                  value:
                    code: 400
                    key: invalid_query_params
                    message: Invalid query params
                    details: Property .cursor must match pattern "^lcrserna_[a-f0-9]+$"
                    request_id: v-12f90062450611349b
                Cursor invalid or expired:
                  value:
                    code: 400
                    key: invalid_or_expired_cursor
                    message: Invalid or expired cursor
                    details: The provided cursor is invalid or has expired
                    request_id: v-12f90062450611349c
                Cursor does not match query:
                  value:
                    code: 400
                    key: cursor_and_query_mismatch
                    message: Cursor and query mismatch
                    details: >-
                      The provided cursor does not match the query, either the
                      cursor is invalid or the query has changed
                    request_id: v-12f90062450611349d
                Cursor from another list:
                  value:
                    code: 400
                    key: invalid_cursor
                    message: Invalid cursor
                    details: The provided cursor is invalid
                    request_id: v-12f90062450611349e
                Limit too high:
                  value:
                    code: 400
                    key: invalid_query_params
                    message: Invalid query params
                    details: Property .limit cannot be greater than 100
                    request_id: v-12f90062450611349f
                Limit too low:
                  value:
                    code: 400
                    key: invalid_query_params
                    message: Invalid query params
                    details: Property .limit cannot be lower than 1
                    request_id: v-12f9006245061134a0
                Unsupported order value:
                  value:
                    code: 400
                    key: invalid_query_params
                    message: Invalid query params
                    details: >-
                      Property .order must be equal to one of the allowed values
                      [ -created_at, created_at ]
                    request_id: v-12f9006245061134a1
                Conflicting order values:
                  value:
                    code: 400
                    key: invalid_query_params
                    message: Invalid query params
                    details: >-
                      Query cannot be ordered by 'created_at' and '-created_at'
                      at the same time
                    request_id: v-12f9006245061134a2
        '404':
          description: >-
            Program not found. Returned for any unknown program id, including a
            value that does not match `lprg_[a-f0-9]+`.
          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_18f58429f4c4bf7b2
                    request_id: v-131f936f8b622332dd
                    resource_id: lprg_18f58429f4c4bf7b2
                    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 non-existent-program-id
                    request_id: v-131f936f8b622332de
                    resource_id: non-existent-program-id
                    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:
    V2LoyaltiesProgramsEarningRulesListResponseBody:
      title: V2 Loyalties Programs Earning Rules List Response Body
      type: object
      description: >-
        Response body schema for **GET**
        `/v2/loyalties/programs/{programId}/earning-rules`.
      allOf:
        - $ref: '#/components/schemas/ProgramEarningRuleAssignmentListResponse'
    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.
    ProgramEarningRuleAssignmentListResponse:
      type: object
      description: Cursor-paginated list of earning rule assignments.
      properties:
        object:
          type: string
          description: Object type marker. Always `list`.
          const: list
        data:
          type: array
          description: Earning rule assignments on the current page.
          items:
            $ref: '#/components/schemas/ProgramEarningRuleAssignment'
        cursor:
          description: Pagination cursor. `null` when there are no more results.
          oneOf:
            - $ref: '#/components/schemas/ProgramListCursor'
            - type: 'null'
      required:
        - object
        - data
        - cursor
    ProgramEarningRuleAssignment:
      type: object
      description: An earning rule assigned to a program.
      properties:
        earning_rule_id:
          type: string
          description: Unique earning rule identifier.
          pattern: ^lern_[a-f0-9]+$
        created_at:
          type: string
          format: date-time
          description: Assignment creation timestamp (ISO 8601).
        object:
          type: string
          description: Object type marker. Always `program_earning_rule`.
          const: program_earning_rule
      required:
        - earning_rule_id
        - created_at
        - object
    ProgramListCursor:
      type: object
      description: >-
        Cursor for fetching the next page of results. Present only when more
        results are available.
      properties:
        next:
          type: string
          description: >-
            Cursor id to pass as the `cursor` query parameter in the next
            request.
        expires_at:
          type: string
          format: date-time
          description: Timestamp after which the cursor expires and can no longer be used.
  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.