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

# Update a product

> Atualiza parcialmente um produto. Campos invalidos podem ser descartados no preprocessamento.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/product
openapi: 3.1.1
info:
  title: Veepag API
  description: >-
    API publica da Veepag para transacoes, clientes, assinaturas, produtos,
    cobrancas e alertas.


    Autentique as chamadas com o header `apiKey` no formato `keyId.secret` ou
    com o header `token` contendo um JWT valido.

    Use o ambiente de sandbox para testes e producao apenas depois da
    homologacao.
  version: 1.0.0
  contact: {}
servers:
  - url: https://sandbox.api.veepag.com
    description: Sandbox
  - url: https://api.veepag.com
    description: Produção
security:
  - api_key: []
  - token: []
tags:
  - name: Transaction
    description: >-
      Pagamentos avulsos, captura, cancelamento, consulta e exportacao de
      transacoes.
  - name: Client
    description: Cadastro, atualizacao e consulta de clientes.
  - name: Subscription
    description: Criacao, consulta, atualizacao e cancelamento de assinaturas.
  - name: Product
    description: Configuracao de produtos, precos e regras de cobranca.
  - name: Charge
    description: Criacao, pagamento, cancelamento e conciliacao de cobrancas.
  - name: Alert
    description: Consulta e tratamento de alertas Ethoca/Visa.
paths:
  /v1/product:
    put:
      tags:
        - Product
      summary: Update a product
      description: >-
        Atualiza parcialmente um produto. Campos invalidos podem ser descartados
        no preprocessamento.
      operationId: ProductController_updateProduct
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductDto'
      responses:
        '200':
          description: Produto atualizado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
              example:
                _id: product_id
                active: true
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error_messages:
                  - msg: Payload invalido.
                    type: field
                    path: companyId
                    location: body
                code: ZodValidationException
                path: /v1/product
                metadata: {}
        '401':
          description: Credencial ausente ou invalida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error_messages:
                  - msg: Unauthorized.
                code: unauthorized
                path: /v1/product
                metadata: {}
        '403':
          description: Credencial sem acesso ao recurso ou empresa solicitada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error_messages:
                  - msg: Forbidden.
                code: forbidden
                path: /v1/product
                metadata: {}
        '500':
          description: Erro interno nao mapeado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error_messages:
                  - msg: Unknown server error.
                code: unknown_server_error
                path: /v1/product
                metadata: {}
      security:
        - api_key: []
        - token: []
components:
  schemas:
    UpdateProductDto:
      type: object
      properties:
        companyId:
          type: string
          description: ID da empresa dona do produto.
        active:
          type: boolean
          description: Indica se o produto esta ativo.
        deleted:
          type: boolean
          description: Indica exclusao logica do produto.
        setting:
          type: object
          properties:
            re1to1:
              type: boolean
            successChargeDay:
              type: boolean
            cardAuth:
              type:
                - boolean
                - 'null'
            limitOverdueCharges:
              type: object
              properties:
                active:
                  type: boolean
                qty:
                  type: integer
                  exclusiveMinimum: 0
          description: Configuracoes gerais do produto.
        charge:
          type: object
          properties:
            frequencyDays:
              type: integer
              minimum: 0
            deniedIntervalDays:
              type: integer
              minimum: 0
            maxDeniedAttempts:
              type: integer
              minimum: 0
            invoiceIdentification:
              type: string
            paymentMethod:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - CREDIT_CARD
                      - DEBIT_CARD
                      - BOLETO
                      - PIX
                    x-enumNames:
                      - CREDIT_CARD
                      - DEBIT_CARD
                      - BOLETO
                      - PIX
                  active:
                    type: boolean
                  installments:
                    type: array
                    items:
                      type: object
                      properties:
                        installment:
                          type: integer
                          exclusiveMinimum: 0
                        fee:
                          type: number
                          minimum: 0
                        totalAmount:
                          type: number
                          minimum: 0
                        installmentAmount:
                          type: number
                          minimum: 0
                      required:
                        - installment
            routes:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    enum:
                      - ETHOCA
                      - THE_MEMBERS
                      - rede
                      - rede_zero_dollar
                      - zoop
                      - zoop_v1
                      - veepag
                      - iopay
                      - pagarme_v5
                      - pagarme_v4
                      - pagseguro
                      - pagseguro_v2
                      - cielo
                      - cielo_zero_auth
                      - mercadopago
                      - veepag_3ds
                    x-enumNames:
                      - ETHOCA
                      - THE_MEMBERS
                      - REDE
                      - REDE_ZERO_DOLLAR
                      - ZOOP
                      - ZOOP_V1
                      - VEEPAG
                      - IOPAY
                      - PAGAR_ME_V5
                      - PAGAR_ME_V4
                      - PAG_SEGURO
                      - PAG_SEGURO_V2
                      - CIELO
                      - CIELO_ZERO_AUTH
                      - MERCADOPAGO
                      - VEEPAG_3DS
                  integrationId:
                    type: string
                  name:
                    type: string
                  settings:
                    type: object
                    properties:
                      brandCard:
                        type: object
                        properties:
                          all:
                            type: boolean
                          list:
                            type: array
                            items:
                              type: string
                        required:
                          - all
                          - list
                      modality:
                        type: object
                        properties:
                          initial:
                            type: boolean
                          recurring:
                            type: boolean
                        required:
                          - initial
                          - recurring
                  active:
                    type: boolean
                  order:
                    type: integer
                    exclusiveMinimum: 0
                required:
                  - id
                  - integrationId
                  - name
                  - active
              default: []
          description: >-
            Regras de cobranca do produto, como frequencia, tentativas e metodos
            de pagamento.
        product:
          type: object
          properties:
            price:
              type: number
              minimum: 0
            originalPrice:
              type: number
              minimum: 0
            title:
              type: string
            photo:
              type: string
            warranty:
              type: integer
              minimum: 0
            description:
              type: string
            SKU:
              type: string
          description: Dados comerciais do produto, como title, price e warranty.
        unsubscription:
          type: object
          properties:
            type:
              type: string
              enum:
                - OVERDUE_DAYS
                - NEVER
                - CARD_ATTEMPTS
              x-enumNames:
                - OVERDUE_DAYS
                - NEVER
                - CARD_ATTEMPTS
            overdueDays:
              type: integer
              minimum: 0
          description: Regra de cancelamento da assinatura vinculada ao produto.
        checkout:
          type: object
          properties:
            header:
              type: object
              properties:
                color:
                  type: string
                fixed:
                  type: boolean
                active:
                  type: boolean
                logo:
                  type: string
            topBanner:
              type: object
              properties:
                active:
                  type: boolean
                url:
                  type: string
            sideBanner:
              type: object
              properties:
                active:
                  type: boolean
                url:
                  type: string
            contact:
              type: object
              properties:
                active:
                  type: boolean
                text:
                  type: string
            terms:
              type: object
              properties:
                active:
                  type: boolean
                text:
                  type: string
            privacyterms:
              type: object
              properties:
                active:
                  type: boolean
                linkTermsUse:
                  type: string
                linkPrivacyPolicy:
                  type: string
            tracking:
              type: object
              properties:
                meta:
                  type: string
                gtm:
                  type: string
            color:
              type: object
              properties:
                textPrimary:
                  type: string
                secondary:
                  type: string
                background:
                  type: string
                primary:
                  type: string
                textSecondary:
                  type: string
            countdown:
              type: object
              properties:
                time:
                  type: integer
                  exclusiveMinimum: 0
                fixed:
                  type: boolean
                active:
                  type: boolean
                color:
                  type: object
                  properties:
                    background:
                      type: string
                    text:
                      type: string
            faq:
              type: object
              properties:
                active:
                  type: boolean
                list:
                  type: array
                  items:
                    type: object
                    properties:
                      question:
                        type: string
                      answer:
                        type: string
          description: Configuracoes de checkout do produto.
        send:
          type: object
          properties:
            active:
              type: boolean
            list:
              type: array
              items:
                type: object
                properties:
                  active:
                    type: boolean
                  id:
                    type: string
                  integrationId:
                    type: string
                  linkAccess:
                    type: string
                  name:
                    type: string
                  productId:
                    type: string
          description: Configuracoes de envio ou entrega associadas ao produto.
        discount:
          type: object
          properties:
            list:
              type: array
              items:
                type: object
                properties:
                  discount:
                    type: object
                    properties:
                      value:
                        type: number
                        minimum: 0
                    required:
                      - value
                  id:
                    type: string
                  method:
                    type: array
                    items:
                      type: string
                  type:
                    type: string
                required:
                  - discount
                  - id
                  - method
                  - type
              default: []
          description: Configuracoes de desconto do produto.
        notification:
          type: object
          properties:
            overdueCharge:
              type: object
              properties:
                email:
                  type: boolean
            paidCharge:
              type: object
              properties:
                email:
                  type: boolean
                message:
                  type: string
          description: Configuracoes de notificacao do produto.
        _id:
          type: string
          description: ID do produto que sera atualizado.
    Product:
      type: object
      properties:
        _id:
          type: string
          description: ID do produto.
        companyId:
          type: string
          description: ID da empresa dona do produto.
        active:
          type: boolean
          description: Indica se o produto esta ativo.
        deleted:
          type: boolean
          description: Indica exclusao logica do produto.
        product:
          type: object
          additionalProperties: true
          description: Dados comerciais do produto, como title e price.
        charge:
          type: object
          additionalProperties: true
          description: Regras de cobranca do produto.
        setting:
          type: object
          additionalProperties: true
          description: Configuracoes gerais do produto.
        unsubscription:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/ProductUnsubscriptionType'
            overdueDays:
              type: integer
              minimum: 0
          description: Regra de cancelamento vinculada ao produto.
    ErrorResponse:
      type: object
      properties:
        error_messages:
          type: array
          items:
            $ref: '#/components/schemas/ErrorMessage'
        code:
          type: string
          example: unauthorized
        path:
          type: string
          example: /v1/transaction
        metadata:
          type: object
          additionalProperties: true
    ProductUnsubscriptionType:
      type: string
      enum:
        - OVERDUE_DAYS
        - NEVER
        - CARD_ATTEMPTS
    ErrorMessage:
      type: object
      properties:
        msg:
          type: string
          example: Unauthorized.
        type:
          type: string
          example: field
        path:
          type: string
          example: companyId
        location:
          type: string
          example: body
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey
      description: API key no formato keyId.secret.
    token:
      type: apiKey
      in: header
      name: token
      description: JWT valido. O token confirmado na codebase tem validade de 14 dias.

````