> ## 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.

# Obtener producto específico

> Obtiene los detalles completos de un producto específico con su inventario



## OpenAPI

````yaml /openapi.yaml get /inventory/{id}
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/{id}:
    get:
      tags:
        - Inventario
      summary: Obtener producto específico
      description: >-
        Obtiene los detalles completos de un producto específico con su
        inventario
      parameters:
        - name: id
          in: path
          required: true
          description: ID del producto
          schema:
            type: integer
            example: 456
      responses:
        '200':
          description: Producto obtenido exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
components:
  schemas:
    ProductResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/Product'
    BaseResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indica si la operación fue exitosa
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - success
    Product:
      type: object
      properties:
        nombre:
          type: string
          example: Smartphone Samsung Galaxy
        descripcion:
          type: string
          nullable: true
          example: Teléfono inteligente de última generación
        codigo:
          type: string
          nullable: true
          example: PHONE-001
        barcode:
          type: string
          nullable: true
          example: '1234567890123'
        precio:
          type: number
          format: float
          nullable: true
          example: 599.99
        costo:
          type: number
          format: float
          nullable: true
          example: 450
        marca:
          type: string
          nullable: true
          example: Samsung
        tipo:
          type: string
          enum:
            - Producto
            - Servicio
          example: Producto
        enable:
          type: string
          enum:
            - '0'
            - '1'
          example: '1'
        nombre_categoria:
          type: string
          nullable: true
          example: Electrónicos
        img:
          type: string
          nullable: true
          example: productos/smartphone.jpg
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        inventarios:
          type: array
          items:
            $ref: '#/components/schemas/InventoryStock'
      required:
        - nombre
        - tipo
        - enable
    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
    InventoryStock:
      type: object
      properties:
        stock:
          type: number
          format: float
          example: 25
        stock_minimo:
          type: number
          format: float
          example: 5
        stock_maximo:
          type: number
          format: float
          example: 100
        nombre_bodega:
          type: string
          nullable: true
          example: Bodega Principal
        nombre_sucursal:
          type: string
          nullable: true
          example: Sucursal Centro
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - stock
        - stock_minimo
        - stock_maximo
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API Key de la empresa en formato Bearer token.

        Ejemplo: `Authorization: Bearer G8RCjH11DabBNjnX7wO5`

````