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

# Get a consumer's aggregated reward information

> Aggregates reward information for consumer `consumer_id` by querying the different backends concurrently. Each backend contributes its own field (e.g. `perks`) and is only included when it responds: a backend that fails, times out or has no data for the consumer is omitted from the payload.



## OpenAPI

````yaml /program/api/openapi/2.0.0/thub/openapi.json get /consumers/{consumer_id}/rewards/info
openapi: 3.1.0
info:
  description: |
    Paylead Program API.
    You can find complete documentation in https://docs.paylead.com/
  license:
    name: Proprietary
    url: https://docs.paylead.com/
  title: Consumers
  version: 2.0.0
servers:
  - description: Sandbox
    url: https://api-{programRef}.sandbox.paylead.tech
    variables:
      programRef:
        default: changeme
        description: Program reference provided by Paylead
security:
  - oauth2: []
tags:
  - description: Routes used to query consumers resources
    name: Consumers
    x-displayName: Consumers
  - name: Rewards
    x-displayName: Rewards
  - description: Routes used to create transactions with a bulk insert
    name: Bulk Transaction
    x-displayName: Bulk Transaction
  - description: >-
      Routes used to query transactions resources based on the transaction id or
      unique id that you defined
    name: Transaction
    x-displayName: Transaction
paths:
  /consumers/{consumer_id}/rewards/info:
    get:
      tags:
        - Rewards
      summary: Get a consumer's aggregated reward information
      description: >-
        Aggregates reward information for consumer `consumer_id` by querying the
        different backends concurrently. Each backend contributes its own field
        (e.g. `perks`) and is only included when it responds: a backend that
        fails, times out or has no data for the consumer is omitted from the
        payload.
      operationId: consumers__consumer_id__rewards__info__get
      parameters:
        - description: >-
            Unique ID of the consumer that you have registered when the user was
            onboarded.
          in: path
          name: consumer_id
          required: true
          schema:
            description: >-
              Unique ID of the consumer that you have registered when the user
              was onboarded.
            maxLength: 100
            minLength: 2
            title: Consumer Id
            type: string
        - examples:
            default:
              value: 2.0.0
          in: header
          name: x-api-version
          required: false
          schema:
            default: 2.0.0
            title: X-Api-Version
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Thub_RewardsInfoResponse'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    Thub_RewardsInfoResponse:
      description: >-
        Aggregated reward information for a consumer.


        Each field maps to a distinct backend and is only present when that
        backend

        responded. Backends are queried concurrently; a backend that fails,
        times out

        or has no data for the consumer is simply omitted from the payload.
      properties:
        perks:
          anyOf:
            - $ref: '#/components/schemas/Thub_PerksRewardInfoOut'
            - type: 'null'
      title: RewardsInfoResponse
      type: object
    ErrorResponse:
      additionalProperties: false
      description: >-
        An error response object (PayLead profile).


        Extension members (e.g. ``errors`` for validation) are allowed and
        serialised as

        top-level keys.
      properties:
        code:
          title: Code
          type: string
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          default: null
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Instance
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
      required:
        - code
        - title
        - status
      title: ErrorResponse
      type: object
    Thub_PerksRewardInfoOut:
      properties:
        can_trigger_pooled:
          description: >-
            Whether the consumer is eligible to trigger a payout of their pooled
            rewards.
          title: Can Trigger Pooled
          type: boolean
        paid:
          $ref: '#/components/schemas/Thub_RewardStatusAggregateOut'
          description: Rewards already paid to the consumer.
        pooled:
          $ref: '#/components/schemas/Thub_RewardStatusAggregateOut'
          description: Validated rewards pooled for the consumer.
        validation:
          $ref: '#/components/schemas/Thub_RewardStatusAggregateOut'
          description: Rewards awaiting validation.
        voucher:
          $ref: '#/components/schemas/Thub_VoucherAggregateOut'
          description: Aggregated data about vouchers purchased by the consumer.
      required:
        - validation
        - pooled
        - paid
        - voucher
        - can_trigger_pooled
      title: PerksRewardInfoOut
      type: object
    Thub_RewardStatusAggregateOut:
      description: Aggregated reward amount and count for a given reward status.
      properties:
        amount:
          description: Total reward amount in this status, as a decimal string.
          examples:
            - '42.50'
          title: Amount
          type: string
        count:
          description: Number of rewards in this status.
          examples:
            - 12
          title: Count
          type: integer
      required:
        - count
        - amount
      title: RewardStatusAggregateOut
      type: object
    Thub_VoucherAggregateOut:
      description: Aggregated voucher count and discount for the consumer.
      properties:
        count:
          description: Number of vouchers issued to the consumer.
          examples:
            - 3
          title: Count
          type: integer
        total_discount:
          description: Cumulated voucher discount amount, as a decimal string.
          examples:
            - '15.00'
          title: Total Discount
          type: string
      required:
        - count
        - total_discount
      title: VoucherAggregateOut
      type: object
  securitySchemes:
    oauth2:
      flows:
        clientCredentials:
          scopes:
            ALL: Full access to all resources (wildcard).
            LOYALTIES: Access to loyalties features.
            PERKS: Access to perks features.
            TX_INJECTION: Access to transaction sharing.
          tokenUrl: /tokens
      type: oauth2

````