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

# Listar clientes

> Devuelve clientes de la organización. Permite buscar por nombre, CUIT o email.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/customers
openapi: 3.1.0
info:
  title: La Pyme API
  description: >-
    Resources and workflows for purchases, sales, inventory, contacts, products,
    reports, and settings.
  version: 1.0.0
  contact:
    name: La Pyme Support
    email: hola@lapyme.com.ar
  license:
    name: Proprietary
    url: https://lapyme.com.ar/terminos
servers:
  - url: https://api.lapyme.com.ar
    description: Servidor de producción
security:
  - bearerAuth: []
tags:
  - name: API
    description: Public API operations for La Pyme integrations.
paths:
  /api/v1/customers:
    get:
      tags:
        - API
      summary: Listar clientes
      description: >-
        Devuelve clientes de la organización. Permite buscar por nombre, CUIT o
        email.
      operationId: listApiCustomers
      parameters:
        - name: cursor
          in: query
          description: Valor de next_cursor recibido en la respuesta anterior
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Cantidad máxima de resultados por respuesta
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: query
          in: query
          description: Texto de búsqueda por nombre, CUIT o email
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: Alias de query
          required: false
          schema:
            type: string
        - name: is_active
          in: query
          description: Filtra por estado activo
          required: false
          schema:
            type: boolean
        - name: status
          in: query
          description: >-
            Estado lógico del cliente. Puede repetirse o enviarse separado por
            comas.
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ApiSharedEnumd952d5ce8e'
          style: form
          explode: true
      responses:
        '200':
          description: Clientes obtenidos exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiCustomerListResponse'
        '400':
          description: Parámetros inválidos
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_customers_1
                    error:
                      code: INVALID_REQUEST
                      message: Invalid parameters for listing customers
                      retryable: false
                      type: invalid_request_error
                      details: []
        '401':
          description: API key faltante o inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: AUTHENTICATION_REQUIRED
                  value:
                    request_id: req_customers_1
                    error:
                      code: AUTHENTICATION_REQUIRED
                      message: API key is required in the Authorization header
                      retryable: false
                      type: invalid_request_error
                      details: []
        '403':
          description: Scopes insuficientes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: FORBIDDEN
                  value:
                    request_id: req_customers_1
                    error:
                      code: FORBIDDEN
                      message: Your API key does not have permission for this operation
                      retryable: false
                      type: invalid_request_error
                      details: []
        '429':
          description: Límite de solicitudes excedido para la organización
          headers:
            Retry-After:
              description: Segundos a esperar antes de volver a intentar la solicitud.
              schema:
                type: string
                example: '30'
            X-RateLimit-Limit:
              description: Límite de la ventana activa.
              schema:
                type: string
                example: '5000'
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: Segundos restantes hasta el reset de la ventana activa.
              schema:
                type: string
                example: '30'
            RateLimit-Limit:
              description: Límite de la ventana activa en formato estándar.
              schema:
                type: string
                example: '5000'
            RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa en formato estándar.
              schema:
                type: string
                example: '0'
            RateLimit-Reset:
              description: >-
                Segundos hasta el reset de la ventana activa en formato
                estándar.
              schema:
                type: string
                example: '30'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: RATE_LIMITED
                  value:
                    request_id: req_rate_limit_1
                    error:
                      type: rate_limit_error
                      code: RATE_LIMITED
                      message: >-
                        The organization request limit was reached. Try again
                        later.
                      retryable: true
                      details: []
        '500':
          description: Error interno del servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INTERNAL_ERROR
                  value:
                    request_id: req_customers_1
                    error:
                      code: INTERNAL_ERROR
                      message: Could not list customers
                      retryable: false
                      type: invalid_request_error
                      details: []
      x-codeSamples:
        - lang: typescript
          label: La Pyme SDK
          source: |
            import { Lapyme } from "lapyme";

            const lapyme = new Lapyme({
              bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
            });

            const customers = await lapyme.customers.get({
              limit: 20,
              query: "Acme",
            });
components:
  schemas:
    ApiSharedEnumd952d5ce8e:
      type: string
      enum:
        - active
        - inactive
    ApiCustomerListResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                const: customer
              id:
                type: string
                format: uuid
              name:
                type: string
              company_name:
                anyOf:
                  - type: string
                  - type: 'null'
              description:
                anyOf:
                  - type: string
                  - type: 'null'
              email:
                anyOf:
                  - type: string
                  - type: 'null'
              phone:
                anyOf:
                  - type: string
                  - type: 'null'
              address:
                anyOf:
                  - type: string
                  - type: 'null'
              apartment:
                anyOf:
                  - type: string
                  - type: 'null'
              city:
                anyOf:
                  - type: string
                  - type: 'null'
              delivery_carrier:
                anyOf:
                  - type: string
                  - type: 'null'
              delivery_address:
                anyOf:
                  - type: string
                  - type: 'null'
              tax_id:
                anyOf:
                  - type: string
                  - type: 'null'
              tax_id_type:
                anyOf:
                  - type: string
                  - type: 'null'
              tax_category:
                anyOf:
                  - type: string
                  - type: 'null'
              contact_type:
                anyOf:
                  - type: string
                  - type: 'null'
              default_price_list_id:
                anyOf:
                  - type: string
                    format: uuid
                  - type: 'null'
              payment_term_id:
                anyOf:
                  - type: string
                  - type: 'null'
              payment_term_days:
                anyOf:
                  - type: integer
                    minimum: 0
                    maximum: 365
                    description: >-
                      Cantidad de días hasta el vencimiento. Usá 0 para Contado.
                      Se prefiere sobre paymentTermId.
                  - type: 'null'
              province_id:
                anyOf:
                  - type: string
                  - type: 'null'
              is_active:
                anyOf:
                  - type: boolean
                  - type: 'null'
              created_at:
                type: string
                format: date-time
              updated_at:
                type: string
                format: date-time
              tags:
                type: array
                items:
                  $ref: '#/components/schemas/ApiSharedObject8a94344083'
            required:
              - object
              - id
              - name
              - company_name
              - description
              - email
              - phone
              - address
              - apartment
              - city
              - delivery_carrier
              - delivery_address
              - tax_id
              - tax_id_type
              - tax_category
              - contact_type
              - default_price_list_id
              - payment_term_id
              - payment_term_days
              - province_id
              - is_active
              - created_at
              - updated_at
              - tags
            additionalProperties: false
        has_more:
          type: boolean
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
        object:
          $ref: '#/components/schemas/ApiSharedEnum8d46e1ec20'
        url:
          type: string
          description: Requested list path.
      required:
        - request_id
        - data
        - has_more
        - next_cursor
        - object
        - url
      additionalProperties: false
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - authorization_error
                - business_error
                - external_dependency_error
                - idempotency_error
                - invalid_request_error
                - rate_limit_error
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObjectc671832641'
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
    ApiSharedObject8a94344083:
      type: object
      properties:
        object:
          type: string
          const: tag
        id:
          type: string
          format: uuid
        scope:
          $ref: '#/components/schemas/ApiSharedEnum09f8155a9a'
        name:
          type: string
        slug:
          type: string
        color:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnum599647cb76'
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - scope
        - name
        - slug
        - color
        - description
        - archived_at
        - created_at
        - updated_at
      additionalProperties: false
    ApiSharedEnum8d46e1ec20:
      type: string
      enum:
        - list
      description: List-envelope discriminator.
    ApiSharedObjectc671832641:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    ApiSharedEnum09f8155a9a:
      type: string
      enum:
        - customer
        - supplier
        - product
        - sale
        - purchase
        - purchase_order
        - transfer
    ApiSharedEnum599647cb76:
      type: string
      enum:
        - slate
        - red
        - orange
        - amber
        - yellow
        - lime
        - green
        - teal
        - cyan
        - blue
        - indigo
        - violet
        - pink
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````