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

# Atualizar Produto

> Atualizar dados de um produto existente

# Atualizar Produto

Atualiza parcialmente um produto existente da empresa autenticada.

## Comportamento atual

* todos os campos do body são opcionais
* `price`, quando fornecido, deve ser `>= 0`
* quando o body vem vazio, o service retorna o estado atual do produto
* a resposta atual mantém o shape de `PublicProductResponse`
* o contrato atual retorna `created_at`; não há `updated_at` no response model desta rota

## Exemplo de resposta

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440222",
    "name": "Combo Família Premium",
    "price": 99.9,
    "quantity": 15,
    "description": "2 pizzas grandes + 1 refrigerante 2L + sobremesa",
    "image_url": null,
    "created_at": "2026-03-20T09:00:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "detail": "Produto não encontrado"
  }
  ```
</ResponseExample>

## Status comuns

* `200` produto atualizado ou retornado com sucesso
* `401` API Key inválida ou revogada
* `403` plano sem `api_access`
* `404` produto inexistente ou fora da empresa autenticada
* `422` header, path ou body inválidos
* `429` limite global da API pública excedido


## OpenAPI

````yaml PUT /api/v1/public/products/{product_id}
openapi: 3.1.0
info:
  contact:
    email: support@indiqai.com
    name: IndiqAI Support
    url: https://indiqai.com/
  description: Especificação OpenAPI da API Pública IndiqAI.
  license:
    name: Proprietary
    url: https://indiqai.com/license
  title: IndiqAI API Pública
  version: 1.5.0
servers:
  - description: Produção
    url: https://api.indiqai.com
security: []
paths:
  /api/v1/public/products/{product_id}:
    put:
      tags:
        - API Pública
      summary: Atualizar produto
      description: Atualiza dados de um produto existente.
      operationId: update_product_api_v1_public_products__product_id__put
      parameters:
        - in: path
          name: product_id
          required: true
          schema:
            title: Product Id
            type: string
        - description: Chave de API
          in: header
          name: X-API-Key
          required: true
          schema:
            description: Chave de API
            title: X-Api-Key
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicProductUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProductResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PublicProductUpdate:
      description: Atualizar produto.
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        name:
          anyOf:
            - maxLength: 255
              type: string
            - type: 'null'
          title: Name
        price:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          title: Price
        quantity:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          title: Quantity
      title: PublicProductUpdate
      type: object
    PublicProductResponse:
      description: Dados de um produto.
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        id:
          title: Id
          type: string
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        name:
          title: Name
          type: string
        price:
          title: Price
          type: number
        quantity:
          title: Quantity
          type: integer
      required:
        - id
        - name
        - price
        - quantity
      title: PublicProductResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````