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

# Atualizar produto do evento

> Atualiza uma linha



## OpenAPI

````yaml /openapi.json patch /events/{event}/products/{eventProduct}
openapi: 3.1.0
info:
  title: Eventor Management API v1
  version: 1.0.0
  description: >-
    Management API do Eventor (Fase 9) — configuração de evento ponta a ponta
    por agente/CLI. Autenticação: `Authorization: Bearer <api_key>` com escopo
    `manage`.


    Envelope de sucesso: `{data}` (item) e `{data,meta,links}` (coleção
    paginada).

    Envelope de erro: `{error,message,details}`.
servers:
  - url: http://localhost/api/v1
security:
  - bearerAuth: []
paths:
  /events/{event}/products/{eventProduct}:
    patch:
      tags:
        - EventProducts
      summary: Atualizar produto do evento
      description: Atualiza uma linha
      operationId: eventProducts.update
      parameters:
        - name: event
          in: path
          required: true
          schema:
            type: string
        - name: eventProduct
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEventProductRequest'
      responses:
        '200':
          description: '`JsonResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/EventProductResource'
                required:
                  - data
        '401':
          description: API key ausente ou inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: A API key não tem o escopo `manage`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Recurso não encontrado neste hub.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: 'Conflito (ex.: dependência que impede a operação).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: Falha de validação dos dados enviados.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    UpdateEventProductRequest:
      type: object
      description: >-
        PATCH /api/v1/events/{event}/products/{eventProduct} — atualização
        parcial de

        uma linha. Não permite trocar o produto da linha (espelha o painel, que
        edita

        qty/preço/desconto/refs). Totais são recalculados pelo model no
        saving().
      properties:
        quantity:
          type: integer
          minimum: 1
        applied_unit_price:
          type: number
          minimum: 0
        discount_total:
          type:
            - number
            - 'null'
          minimum: 0
        sale_reference:
          type:
            - string
            - 'null'
          maxLength: 100
        notes:
          type:
            - string
            - 'null'
          maxLength: 500
      title: UpdateEventProductRequest
    EventProductResource:
      type: object
      properties:
        id:
          type: integer
        event_id:
          type: integer
        product_id:
          type: integer
        parent_id:
          type:
            - integer
            - 'null'
        quantity:
          type:
            - integer
            - 'null'
        table_unit_price:
          type:
            - number
            - 'null'
        table_total:
          type:
            - number
            - 'null'
        applied_unit_price:
          type:
            - number
            - 'null'
        discount_total:
          type:
            - number
            - 'null'
        final_total:
          type:
            - number
            - 'null'
        difference_total:
          type:
            - number
            - 'null'
        unit_cost:
          type:
            - number
            - 'null'
        attributes_schema:
          type:
            - array
            - 'null'
          items: {}
        sale_reference:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
        product:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            type:
              type: string
          required:
            - id
            - name
            - type
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - event_id
        - product_id
        - parent_id
        - quantity
        - table_unit_price
        - table_total
        - applied_unit_price
        - discount_total
        - final_total
        - difference_total
        - unit_cost
        - attributes_schema
        - sale_reference
        - notes
        - created_at
        - updated_at
      title: EventProductResource
    ApiError:
      type: object
      properties:
        error:
          type: string
          description: >-
            Código machine-parseable (ex.: validation_failed, forbidden_scope,
            not_found).
        message:
          type: string
          description: Mensagem legível (português).
        details:
          type:
            - object
            - 'null'
          description: 'Detalhes opcionais (ex.: erros de validação por campo).'
          additionalProperties: {}
      required:
        - error
        - message
      title: ApiError
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        API key do hub com escopo `manage`. Header: `Authorization: Bearer
        <api_key>`.
      scheme: bearer

````