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

# Buscar clientes para flujos comerciales

> Busca clientes por nombre o RUT con filtros comerciales cerrados y devuelve sólo una proyección mínima para ventas.



## OpenAPI

````yaml /generated/specs/sales.json get /api/v1/sales/clients
openapi: 3.0.0
info:
  title: Raul API - Ventas
  description: >-
    Cotizaciones, pipeline, outreach comercial, equipos cotizables y ventas de
    equipamiento.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/sales/clients:
    get:
      tags:
        - Sales Clients
      summary: Buscar clientes para flujos comerciales
      description: >-
        Busca clientes por nombre o RUT con filtros comerciales cerrados y
        devuelve sólo una proyección mínima para ventas.
      operationId: SalesClientSearchController_search
      parameters:
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: integer
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 20
            type: integer
        - name: search
          required: false
          in: query
          schema:
            type: string
            minLength: 1
            maxLength: 200
        - name: sort
          required: false
          in: query
          schema:
            default: gps_count
            type: string
            enum:
              - gps_count
              - client_name
              - rut
              - created_at
              - updated_at
        - name: order
          required: false
          in: query
          schema:
            default: desc
            type: string
            enum:
              - asc
              - desc
        - name: city_id
          required: false
          in: query
          schema:
            type: string
            format: uuid
        - name: has_subscription
          required: false
          in: query
          schema:
            type: boolean
        - name: is_parent
          required: false
          in: query
          schema:
            type: boolean
        - name: exclude_children
          required: false
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Página de clientes comerciales con datos mínimos
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesClientSearchResponseDto'
      security:
        - bearerAuth: []
components:
  schemas:
    SalesClientSearchResponseDto:
      type: object
      properties:
        clients:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/SalesClientSearchItemResponseDto'
        pagination:
          $ref: '#/components/schemas/SalesClientSearchPaginationResponseDto'
      required:
        - clients
        - pagination
    SalesClientSearchItemResponseDto:
      type: object
      properties:
        client_id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
          maxLength: 5000
        fantasy_name:
          type: string
          nullable: true
          maxLength: 5000
        rut:
          type: string
          nullable: true
          maxLength: 40
        city:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        active_gps_count:
          type: integer
          minimum: 0
        has_subscription:
          type: boolean
        is_parent:
          type: boolean
        is_child:
          type: boolean
      required:
        - client_id
        - name
        - fantasy_name
        - rut
        - city
        - region
        - active_gps_count
        - has_subscription
        - is_parent
        - is_child
    SalesClientSearchPaginationResponseDto:
      type: object
      properties:
        total:
          type: integer
          minimum: 0
        page:
          type: integer
          minimum: 1
        limit:
          type: integer
          minimum: 1
          maximum: 100
        total_pages:
          type: integer
          minimum: 0
        has_more:
          type: boolean
      required:
        - total
        - page
        - limit
        - total_pages
        - has_more
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Token de sesión Better Auth para rutas de backoffice; las rutas de
        portal usan su token propio.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.