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

# List Customers

> Retrieve a list of customers. The list can be filtered, sorted, and paginated using the parameters below.



## OpenAPI

````yaml get /customers
openapi: 3.1.0
info:
  title: Customers API
  description: API for managing customers
  version: v1
servers:
  - url: https://api.loopreturns.com/api/v1
security: []
tags:
  - name: Customers
paths:
  /customers:
    get:
      tags:
        - Customers
      summary: List Customers
      description: >-
        Retrieve a list of customers. The list can be filtered, sorted, and
        paginated using the parameters below.
      operationId: listCustomers
      parameters:
        - name: external_id
          in: query
          description: An `external_id` used to filter the customers.
          required: false
          schema:
            type: string
            maxLength: 64
            examples:
              - 28hs67udfh-213csss-12d31ja
        - name: limit
          in: query
          description: The maximum number of customers returned.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 250
            default: 50
            examples:
              - 20
        - name: sort_order
          in: query
          description: The sort order for the results.
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
            examples:
              - asc
        - name: cursor
          in: query
          description: The cursor to return the next page of results.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - customers
                properties:
                  customers:
                    type: array
                    items:
                      $ref: '#/components/schemas/CustomerResponse'
                  next_page_url:
                    type: string
                  previous_page_url:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
      security:
        - read: []
components:
  schemas:
    CustomerResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          format: int64
          description: The unique identifier for the customer, created by Loop.
          examples:
            - 9007199254740991
        external_id:
          type:
            - string
            - 'null'
          description: The identifier used by an external source to identify the customer.
          examples:
            - 71263csss-12uhsdfh-2138dja
        sales_channel:
          type:
            - string
            - 'null'
          examples:
            - shopify
          description: The name of the channel associated with the customer.
        first_name:
          type:
            - string
            - 'null'
          description: The customer's given name.
          examples:
            - Edgar
        last_name:
          type:
            - string
            - 'null'
          description: The customer's surname.
          examples:
            - Martinez
        email:
          type:
            - string
            - 'null'
          description: The customer's email address.
          format: email
          examples:
            - sample@example.com
        phone:
          type:
            - string
            - 'null'
          description: The customer's phone number.
          examples:
            - 678-999-8212
        tags:
          type: array
          items:
            type: string
          examples:
            - - FirstPurchase
              - ReturnCustomer
          description: An array of tags associated with the customer.
    UnauthorizedResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              examples:
                - '401'
            http_code:
              type: string
              examples:
                - GEN-UNAUTHORIZED
            message:
              type: string
              examples:
                - Unauthorized.
    NotFoundResponse:
      type: object
      properties:
        code:
          type: string
          examples:
            - '404'
        http_code:
          type: string
          examples:
            - GEN-NOT-FOUND
        message:
          type: string
          examples:
            - >-
              The customer could not be found. Please verify that the provided
              id is correct.
  securitySchemes:
    read:
      type: apiKey
      in: header
      name: X-Authorization
      description: 'API Scope: "Customers (read)"'
      x-scope: Customers (Read)

````