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

# Get top customers by points earned



## OpenAPI

````yaml /loyalty/admin-api-swagger.json get /api/external/top-customers
openapi: 3.0.1
info:
  description: ''
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://loyalty-admin.appstle.com
security: []
tags:
  - description: >-
      Admin APIs for enrolling customers into the loyalty program, retrieving
      customer loyalty details, and updating profile information such as birth
      date.
    name: Customer Enrollment & Profile
  - description: >-
      Admin APIs for managing customer point balances, transaction history,
      point earning rules, top customers leaderboard, and approving pending
      transactions.
    name: Points & Earn Rules
  - description: >-
      Admin APIs for redeeming customer points, managing redemption rules, and
      validating or updating discount codes generated through loyalty
      redemptions.
    name: Redemptions & Discount Codes
  - description: >-
      Admin APIs for retrieving storefront widget label translations consumed by
      the loyalty widget on the merchant's storefront.
    name: Storefront Widgets & Labels
paths:
  /api/external/top-customers:
    get:
      tags:
        - Points & Earn Rules
      summary: Get top customers by points earned
      operationId: top10CustomerEarnedAndPoints
      parameters:
        - description: API key for authentication
          in: header
          name: X-API-Key
          required: true
          schema:
            type: string
        - description: Pagination parameters (page number, size, sort)
          in: query
          name: pageable
          required: true
          schema:
            $ref: '#/components/schemas/Pageable'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopCustomerVM'
          description: Successfully retrieved top customers with pagination headers
          headers:
            Link:
              description: Pagination links for navigating results
              schema:
                type: string
              style: simple
            X-Total-Count:
              description: Total number of customers
              schema:
                type: integer
              style: simple
        '401':
          description: Unauthorized - Invalid or missing X-API-Key
      security:
        - X-API-Key: []
components:
  schemas:
    Pageable:
      properties:
        page:
          format: int32
          minimum: 0
          type: integer
        size:
          format: int32
          minimum: 1
          type: integer
        sort:
          items:
            type: string
          type: array
      type: object
    TopCustomerVM:
      properties:
        activitiesCompleted:
          format: int64
          type: integer
        customerId:
          format: int64
          type: integer
        firstName:
          type: string
        lastName:
          type: string
        pointsEarned:
          format: double
          type: number
      type: object

````