Skip to main content
GET
/
api
/
v1
/
vendedores
List Vendedores
curl --request GET \
  --url https://api.example.com/api/v1/vendedores
{
  "success": true,
  "data": [
    {
      "id": "770e8400-e29b-41d4-a716-446655440000",
      "name": "Carlos Martínez",
      "username": "cmartinez",
      "email": "[email protected]",
      "phone": "8091234567",
      "role": "VENDEDOR",
      "ventanaId": "660e8400-e29b-41d4-a716-446655440000",
      "code": "CM001",
      "isActive": true,
      "settings": {
        "theme": "dark",
        "print": {
          "width": 58,
          "barcode": true
        }
      },
      "platform": "android",
      "appVersion": "2.0.7",
      "createdAt": "2024-03-15T13:00:00Z",
      "updatedAt": "2024-03-15T13:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "pageSize": 20,
    "total": 1,
    "totalPages": 1
  }
}

Overview

Retrieves a paginated list of vendedores (sellers) with optional filtering. VENTANA users can only see vendedores within their own ventana.

Authorization

Required: Valid JWT token (all authenticated users)
Permissions:
  • ADMIN: Can see all vendedores
  • VENTANA: Can only see vendedores in their ventana (automatically filtered)
  • VENDEDOR: Can see all vendedores

Query Parameters

page
number
default:"1"
Page number (must be positive integer)
pageSize
number
default:"20"
Number of items per page (1-100)
Search term to filter vendedores. Searches across name, username, email, phone, and code fields.
ventanaId
string
Filter by ventana UUID (ADMIN only - ignored for VENTANA users who are auto-filtered)

Response

success
boolean
Indicates if the request was successful
data
array
Array of vendedor user objects (password excluded)
meta
object
Pagination metadata
{
  "success": true,
  "data": [
    {
      "id": "770e8400-e29b-41d4-a716-446655440000",
      "name": "Carlos Martínez",
      "username": "cmartinez",
      "email": "[email protected]",
      "phone": "8091234567",
      "role": "VENDEDOR",
      "ventanaId": "660e8400-e29b-41d4-a716-446655440000",
      "code": "CM001",
      "isActive": true,
      "settings": {
        "theme": "dark",
        "print": {
          "width": 58,
          "barcode": true
        }
      },
      "platform": "android",
      "appVersion": "2.0.7",
      "createdAt": "2024-03-15T13:00:00Z",
      "updatedAt": "2024-03-15T13:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "pageSize": 20,
    "total": 1,
    "totalPages": 1
  }
}

Notes

  • Password field is never included in response
  • VENTANA users automatically filtered to see only vendedores in their ventana (see src/api/v1/controllers/vendedor.controller.ts:59-63)
  • Search uses PostgreSQL trigram indexes for fuzzy matching
  • Soft-deleted vendedores are excluded from results
  • Only returns users with VENDEDOR role
  • Implementation: src/api/v1/controllers/vendedor.controller.ts:53-66

Build docs developers (and LLMs) love