> ## 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 Referral Code Holders

> Retrieves the holders of the referral code from a referral campaign.

To use this endpoint, you must have the following permissions:

- Read Customers (`customers.details.read`)

> 📘 Alternative endpoint
>
>This endpoint is an alternative to the [List Member Holders endpoint](/api-reference/referrals/list-referral-code-holders-with-campaign-id). The URL was re-designed to retrieve the referral member holders without providing the `campaignId` as a path paremeter.



## OpenAPI

````yaml /openapi/referrals.json get /v1/referrals/members/{memberId}/holders
openapi: 3.0.1
info:
  title: Voucherify API - Referrals
  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:
  /v1/referrals/members/{memberId}/holders:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterMemberId'
        name: memberId
        in: path
        required: true
        description: Unique referral code or its identifier.
    get:
      tags:
        - Referrals
      summary: List Referral Code Holders
      description: >-
        Retrieves the holders of the referral code from a referral campaign.


        To use this endpoint, you must have the following permissions:


        - Read Customers (`customers.details.read`)


        > 📘 Alternative endpoint

        >

        >This endpoint is an alternative to the [List Member Holders
        endpoint](/api-reference/referrals/list-referral-code-holders-with-campaign-id).
        The URL was re-designed to retrieve the referral member holders without
        providing the `campaignId` as a path paremeter.
      operationId: referrals-code-holders-1
      parameters:
        - $ref: '#/components/parameters/limit'
        - schema:
            $ref: '#/components/schemas/ParameterOrderListRedeemables'
          in: query
          name: order
          description: >-
            Sorts the results using one of the filtering options, where the dash
            - preceding a sorting option means sorting in a descending order.
        - schema:
            $ref: '#/components/schemas/ParameterString'
          in: query
          name: starting_after_id
          description: >-
            A cursor for pagination. It retrieves the events starting after an
            event with the given ID.
        - name: filters
          in: query
          schema:
            $ref: >-
              #/components/schemas/ParameterFiltersListReferralsRedeemableHolders
          description: Filters for listing customer redeemables.
          style: deepObject
          explode: true
      responses:
        '200':
          description: >-
            Returns the holders of the redeemable that is assigned to the
            referral campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralsMembersHoldersListResponseBody'
              examples:
                Example:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: rh_0e7213a6bc407b8639
                        created_at: '2024-03-15T09:08:50.529Z'
                        redeemable_id: v_jFVcN1f5ofg707z2G3GYWtMyKJ4usss4
                        redeemable_object: voucher
                        campaign_id: camp_td1gcD4feTAjUKQYfg40kWhN
                        campaign_type: REFERRAL_PROGRAM
                        voucher_type: DISCOUNT_VOUCHER
                        customer_id: cust_XDwHXVBSZZAJgjpHvrgUHx3J
                        holder_role: REFERRER
                        object: redeemable_holder
                      - id: rh_0e6d0b84960f447f52
                        created_at: '2024-03-11T11:20:54.093Z'
                        redeemable_id: v_jFVcN1f5ofg707z2G3GYWtMyKJ4usss4
                        redeemable_object: voucher
                        campaign_id: camp_td1gcD4feTAjUKQYfg40kWhN
                        campaign_type: null
                        voucher_type: DISCOUNT_VOUCHER
                        customer_id: cust_1B9wkAcSz5O1Y4Zn8JPfKQm6
                        holder_role: OWNER
                        object: redeemable_holder
                    total: 2
                    has_more: false
        '404':
          description: Returns an error if a resource is not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Resource not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: >-
                      Cannot find voucher with id
                      v_wnd4fslUpkLnZH0KthYDxouBSgn24Yr
                    request_id: v-0eed8b989da91a1622
                    resource_id: v_wnd4fslUpkLnZH0KthYDxouBSgn24Yr
                    resource_type: voucher
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - referrals
components:
  schemas:
    ParameterMemberId:
      type: string
      example: MmFAzfDe
    ParameterOrderListRedeemables:
      type: string
      enum:
        - id
        - '-id'
    ParameterString:
      type: string
    ParameterFiltersListReferralsRedeemableHolders:
      type: object
      properties:
        id:
          type: object
          description: Unique redeemable holder ID, i.e. `rh_0e77502f84f0f4a6a8`.
          properties:
            conditions:
              $ref: '#/components/schemas/FilterConditionsString'
        created_at:
          description: >-
            Timestamp representing the date and time when the redeemable was
            added to the holder. The value is shown in the ISO 8601 format.
          type: object
          properties:
            conditions:
              $ref: '#/components/schemas/FilterConditionsDateTime'
        holder_role:
          type: object
          description: |-
            Holder role of the redeemable. Allowed values:
            `REFEREE`,
            `REFERRER`
          properties:
            conditions:
              properties:
                $in:
                  type: array
                  description: >-
                    Array of resource values that should be included in the
                    results (multiple values).
                  items:
                    type: string
                    enum:
                      - REFEREE
                      - REFERRER
                $not_in:
                  type: array
                  description: >-
                    Array of resource values that should be included in the
                    results (multiple values).
                  items:
                    type: string
                    enum:
                      - REFEREE
                      - REFERRER
                $is:
                  type: string
                  description: Value is exactly this value (single value).
                  enum:
                    - REFEREE
                    - REFERRER
                $is_not:
                  type: string
                  description: Results omit this value (single value).
                  enum:
                    - REFEREE
                    - REFERRER
                $has_value:
                  type: string
                  description: >-
                    Value is NOT null. The value for this parameter is an empty
                    string.
                $is_unknown:
                  type: string
                  description: >-
                    Value is null. The value for this parameter is an empty
                    string.
                $starts_with:
                  type: string
                  description: Value starts with the specified string.
                $ends_with:
                  type: string
                  description: Value ends with the specified string.
        customer_id:
          type: object
          description: Unique customer ID, i.e. `cust_sehkNIi8Uq2qQuRqSr7xn4Zi`.
          properties:
            conditions:
              $ref: '#/components/schemas/FilterConditionsString'
        junction:
          $ref: '#/components/schemas/Junction'
    ReferralsMembersHoldersListResponseBody:
      type: object
      title: Referrals Redeemable Holders List Response Body
      description: >-
        Response body schema for **GET**
        `v1/referrals/{campaignId}/members/{memberId}/holders` and for **GET**
        `v1/referrals/members/{memberId}/holders`
      allOf:
        - $ref: '#/components/schemas/RedeemableHoldersList'
    Error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        resource_id:
          type: string
          description: >-
            Unique resource ID that can be used in another endpoint to get more
            details.
          example: rf_0c5d710a87c8a31f86
        resource_type:
          type: string
          description: The resource type.
          example: voucher
        error:
          type: object
          description: Includes additional information about the error.
          properties:
            message:
              type: string
              description: The message configured by the user in a validation rule.
      required:
        - code
        - message
    ParameterLimit:
      type: integer
      maximum: 100
      minimum: 1
    FilterConditionsString:
      title: Filter by conditions
      type: object
      description: >-
        Data filters used to narrow down the data records to be returned in the
        result.
      properties:
        $in:
          type: array
          description: >-
            Array of resource values that should be included in the results
            (multiple values).
          items:
            type: string
        $not_in:
          type: array
          description: >-
            Array of resource values that should be included in the results
            (multiple values).
          items:
            type: string
        $is:
          type: string
          description: Value is exactly this value (single value).
        $is_not:
          type: string
          description: Results omit this value (single value).
        $has_value:
          type: string
          description: Value is NOT null. The value for this parameter is an empty string.
        $is_unknown:
          type: string
          description: Value is null. The value for this parameter is an empty string.
        $starts_with:
          type: string
          description: Value starts with the specified string.
        $ends_with:
          type: string
          description: Value ends with the specified string.
        $contains:
          type: string
          description: Value includes the specified string.
        $not_contain:
          type: string
          description: Value does NOT include the specified string.
    FilterConditionsDateTime:
      title: Filter by conditions
      type: object
      description: >-
        Data filters used to narrow down the data records to be returned in the
        result.
      properties:
        $after:
          type: string
          description: >-
            Value is after this date. The value for this parameter is shown in
            the ISO 8601 format.
          format: date-time
          example: '2024-01-01T00:00:00.000Z'
        $before:
          type: string
          description: >-
            Value is before this date. The value for this parameter is shown in
            the ISO 8601 format.
          format: date-time
          example: '2024-01-01T00:00:00.000Z'
        $has_value:
          type: string
          description: Value is NOT null. The value for this parameter is an empty string.
        $is_unknown:
          type: string
          description: Value is null. The value for this parameter is an empty string.
        $more_than:
          type: integer
          description: >-
            Value is more days ago before the current date and time, e.g. more
            than `10` days ago.
        $less_than:
          type: integer
          description: >-
            Value is less days before the current date and time, e.g. less than
            `10` days ago.
    Junction:
      title: Junction
      description: >-
        Logical Operator Between Filters. Filter by conditions set on the
        `junction` parameter indicating how the `conditions` should be accounted
        for in the query. An `AND` is an all-inclusive logical operator, meaning
        the `AND` operator displays a record if **ALL** the conditions separated
        by AND are TRUE, while  an `OR` operator displays a record if **ANY** of
        the conditions separated by OR is TRUE.
      enum:
        - and
        - or
      type: string
    RedeemableHoldersList:
      type: object
      title: Redeemable Holders List
      description: List of Holder's Redeemables
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about redeemables holders
          default: list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            holders.
          default: data
        data:
          type: array
          description: A dictionary that contains an array of holders.
          items:
            $ref: '#/components/schemas/RedeemableHolder'
        total:
          type: integer
          description: Total number of holders assigned to the redeemable.
        has_more:
          type: boolean
          description: >-
            As query results are always limited (by the limit parameter), the
            `has_more` flag indicates if there are more records for given filter
            parameters. This lets you know if you can run another request with a
            `starting_after_id` query or a different limit to get more records
            returned in the results.
        more_starting_after:
          type: string
          description: >-
            Returns an ID that can be used to return another page of results.
            Use the ID in the `starting_after_id` query parameter to display
            another page of the results occuring after the field with that ID.
      required:
        - object
        - data_ref
        - data
        - total
        - has_more
    RedeemableHolder:
      type: object
      title: Customer Redeemable
      description: Single customer's redeemable
      properties:
        id:
          type: string
          description: Unique identifier of the redeemable holder.
          example: rh_0e7b8db4700106a852
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the redeemable was
            assigned. The value is shown in the ISO 8601 format.
          example: '2024-03-22T17:48:25.910Z'
        redeemable_id:
          type: string
          description: Identifier of the redeemable item.
          example: v_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1
        redeemable_object:
          type: string
          description: Type of the redeemable.
          example: voucher
        customer_id:
          type: string
          description: Unique identifier of the customer.
          example: cust_p1ufreYbVbwZ1x70nFkH9rF9
        holder_role:
          type: string
          description: Role of the holder.
          enum:
            - OWNER
            - REFERRER
            - REFEREE
          example: OWNER
        campaign_id:
          type: string
          description: Unique identifier of the campaign as assigned by Voucherify.
          example: camp_weer1c3p5ZgktqfW56RfoNaG
        campaign_type:
          type: string
          description: Defines the type of the campaign.
          default: REFERRAL_PROGRAM
          enum:
            - REFERRAL_PROGRAM
          example: REFERRAL_PROGRAM
        voucher_type:
          type: string
          description: Defines the type of the voucher.
          enum:
            - GIFT_VOUCHER
            - DISCOUNT_VOUCHER
            - LOYALTY_CARD
          example: DISCOUNT_VOUCHER
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a redeemable
            holder. The metadata object stores all custom attributes assigned to
            the `redeemable_holder` object.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: redeemable_holder
          enum:
            - redeemable_holder
      required:
        - id
        - created_at
        - redeemable_id
        - redeemable_object
        - customer_id
        - holder_role
        - campaign_id
        - campaign_type
        - voucher_type
        - object
  parameters:
    limit:
      name: limit
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterLimit'
      description: >-
        Limits the number of objects to be returned. The limit can range between
        1 and 100 items. If no limit is set, it returns 10 items.
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````