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

# Criar Produto

> Cadastrar um novo produto no catálogo da empresa

# Criar Produto

Cadastra um novo produto no catálogo da empresa autenticada.

## Comportamento atual

* `name` e `price` são obrigatórios
* `quantity` é opcional e, quando omitido, usa `0`
* o contrato atual aceita `price >= 0`
* a resposta retorna `id`, `name`, `price`, `quantity`, `description`, `image_url` e `created_at`

## Exemplo de resposta

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

## Status comuns

* `201` produto criado com sucesso
* `401` API Key inválida ou revogada
* `403` plano sem `api_access`
* `422` header ou body inválidos
* `429` limite global da API pública excedido


## OpenAPI

````yaml POST /api/v1/public/products
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:
    post:
      tags:
        - API Pública
      summary: Criar produto
      description: Cria um novo produto para a empresa.
      operationId: create_product_api_v1_public_products_post
      parameters:
        - 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/PublicProductCreate'
        required: true
      responses:
        '201':
          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:
    PublicProductCreate:
      description: Criar produto.
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        name:
          maxLength: 255
          minLength: 1
          title: Name
          type: string
        price:
          minimum: 0
          title: Price
          type: number
        quantity:
          default: 0
          minimum: 0
          title: Quantity
          type: integer
      required:
        - name
        - price
      title: PublicProductCreate
      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

````