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

# Resumen de inventario

> Obtiene un resumen estadístico del inventario con filtros opcionales.

Incluye totales de productos, stock y distribución por categorías.




## OpenAPI

````yaml /openapi.yaml get /inventory/summary
openapi: 3.0.0
info:
  title: SmartPYME External API
  description: >
    API Externa de SmartPYME para proveedores terceros.


    Permite consultar y registrar ventas, consultar inventario y devoluciones, e
    importar paquetes usando autenticación por API Key.


    ## Autenticación

    Todas las requests requieren un API Key válido en el header Authorization:

    ```

    Authorization: Bearer {tu_api_key}

    ```


    ## Rate Limiting

    - Sin filtros de fecha: 1000 requests/hora

    - Con filtros de fecha: 2000 requests/hora


    ## Paginación

    Todos los endpoints de lista soportan paginación:

    - `page`: Número de página (default: 1)

    - `per_page`: Registros por página (1-200, default: 100)
  version: 1.4.0
  contact:
    name: SmartPYME Support
    email: soporte@smartpyme.com
  license:
    name: Propietario
    url: https://smartpyme.com/terms
servers:
  - url: https://tu-dominio.com/api/external/v1
    description: Servidor de Producción
  - url: http://localhost/api/external/v1
    description: Servidor de Desarrollo
security:
  - ApiKeyAuth: []
paths:
  /inventory/summary:
    get:
      tags:
        - Inventario
      summary: Resumen de inventario
      description: |
        Obtiene un resumen estadístico del inventario con filtros opcionales.

        Incluye totales de productos, stock y distribución por categorías.
      parameters:
        - name: categoria
          in: query
          description: Filtrar resumen por categoría
          schema:
            type: string
        - name: tipo
          in: query
          description: Filtrar por tipo de producto
          schema:
            type: string
            enum:
              - Producto
              - Servicio
        - name: enable
          in: query
          description: Filtrar por estado del producto
          schema:
            type: string
            enum:
              - '0'
              - '1'
      responses:
        '200':
          description: Resumen de inventario obtenido exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventorySummaryResponse'
components:
  schemas:
    InventorySummaryResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                productos:
                  type: object
                  properties:
                    total:
                      type: integer
                      example: 500
                    activos:
                      type: integer
                      example: 480
                    inactivos:
                      type: integer
                      example: 20
                inventario:
                  type: object
                  properties:
                    stock_total:
                      type: number
                      format: float
                      example: 15750.5
                    valor_total:
                      type: number
                      format: float
                      example: 125000.75
                    productos_con_stock:
                      type: integer
                      example: 450
                    productos_sin_stock:
                      type: integer
                      example: 30
                    productos_stock_bajo:
                      type: integer
                      example: 15
                productos_por_categoria:
                  type: array
                  items:
                    type: object
                    properties:
                      categoria:
                        type: string
                        example: Electrónicos
                      cantidad:
                        type: integer
                        example: 150
    BaseResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indica si la operación fue exitosa
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - success
    Meta:
      type: object
      properties:
        empresa:
          type: string
          description: Nombre de la empresa
          example: Mi Empresa S.A.
        timestamp:
          type: string
          format: date-time
          description: Timestamp de la respuesta
        filters_applied:
          type: object
          description: Filtros aplicados en la consulta
      required:
        - empresa
        - timestamp
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API Key de la empresa en formato Bearer token.

        Ejemplo: `Authorization: Bearer G8RCjH11DabBNjnX7wO5`

````