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

# Substituir produto

> Substitui a representação inteira de um produto da conta da chave, então envie todos os campos obrigatórios, e não apenas os que mudam. Um produto de outra conta responde `404` sem escrever nada. Exige o escopo `products:write` e o header `Idempotency-Key`.



## OpenAPI

````yaml /apps/seller/openapi.json put /public/products/{id}
openapi: 3.1.0
info:
  title: SpeedSellX API
  version: 2.0.0
  description: >-
    API pública da SpeedSellX para consultar e atualizar, por integração, os
    dados da sua conta: produtos, pedidos, reembolsos, chargebacks, checkouts,
    upsells, webhooks, assinaturas, vendas e métricas.


    Autentique com `Authorization: Bearer sk_live_...` e gere chaves no painel,
    em Desenvolvedores. Requisições que alteram dados exigem o header
    `Idempotency-Key`. Listagens aceitam `page`/`per_page` (padrão 15) e
    retornam `{ data, links, meta }`.
servers:
  - url: https://api.speedsellx.io/v2
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: Ping
    description: A chamada que prova que a chave funciona.
  - name: Pedidos
    description: Os pedidos da conta da chave.
  - name: Reembolsos
    description: Os pedidos de reembolso da conta da chave.
  - name: Produtos
    description: >-
      O catálogo da conta da chave: leitura, criação, substituição, preço e
      arquivamento.
  - name: Checkouts
    description: Os checkouts da conta da chave e a personalização deles.
  - name: Assinaturas
    description: As assinaturas recorrentes da conta da chave.
  - name: Upsells
    description: As ofertas de upsell da conta da chave.
  - name: Métricas
    description: Os agregados da conta da chave.
  - name: Vendas
    description: O resumo de vendas pagas por janela de datas.
  - name: Chargebacks
    description: Os chargebacks abertos contra a conta da chave.
  - name: Webhooks
    description: As assinaturas de webhook da conta da chave.
paths:
  /public/products/{id}:
    put:
      tags:
        - Produtos
      summary: Substituir produto
      description: >-
        Substitui a representação inteira de um produto da conta da chave, então
        envie todos os campos obrigatórios, e não apenas os que mudam. Um
        produto de outra conta responde `404` sem escrever nada. Exige o escopo
        `products:write` e o header `Idempotency-Key`.
      operationId: publicapi.products.update
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Chave única da operação. Obrigatória em toda requisição que altera
            dados; sem ela a resposta é `422` `idempotency_key_required`. Um
            reenvio com a mesma chave e o mesmo corpo repete a resposta
            guardada.
          schema:
            type: string
            maxLength: 255
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateApiProductRequest'
      responses:
        '200':
          description: '`ApiProductResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ApiProductResource'
                required:
                  - data
        '401':
          description: Chave ausente, inválida ou revogada.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: string
                    const: unauthenticated
                required:
                  - status
                  - error
        '403':
          description: A chave não tem o escopo que a rota exige.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: string
                    const: insufficient_scope
                required:
                  - status
                  - error
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: string
                    const: not_found
                required:
                  - status
                  - error
        '409':
          description: >-
            `idempotency_in_progress` quando já há uma requisição com essa
            `Idempotency-Key` em andamento; `idempotency_key_reuse` quando a
            chave voltou com outro corpo.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: string
                    enum:
                      - idempotency_in_progress
                      - idempotency_key_reuse
                required:
                  - status
                  - error
        '422':
          $ref: '#/components/responses/ValidationException'
        '429':
          description: Limite de requisições por minuto excedido para esta chave.
components:
  schemas:
    UpdateApiProductRequest:
      type: object
      description: >-
        Body of PUT /v2/public/products/{id}. A PUT replaces the whole
        representation,

        so it accepts exactly what a create accepts, price included; the source
        api

        declared its update request the same way (SHA 70cd772).


        The price is not part of the attribute write in the core (it moves
        through its

        own operation so the acquirer is re-synced), so the controller applies
        it

        separately when it differs from what is stored.
      properties:
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 255
        image:
          type: string
          description: |-
            Either a base64 data URI (uploaded to storage) or an already stored
            path echoed back. Which one it is, is Catalog's decision.
        category_id:
          type: integer
          minimum: 1
        language_id:
          type: integer
          minimum: 1
        payment_type:
          type: string
          enum:
            - unique
            - recurring
        recurrence_interval:
          type:
            - string
            - 'null'
          enum:
            - daily
            - weekly
            - fortnightly
            - monthly
            - twomonthly
            - quarterly
            - semiannual
            - yearly
            - null
        price:
          type: number
          minimum: 0
        currency:
          type: string
          enum:
            - brl
            - usd
            - eur
        type:
          type: string
          enum:
            - physical
            - digital
        publish_status:
          type: string
          enum:
            - draft
            - published
        delivery:
          type: string
          enum:
            - nothing
            - memberkit
            - cademi
            - rocketmember
            - astronmembers
            - download
            - external
        warranty_time:
          type: integer
          enum:
            - '7'
            - '14'
            - '21'
            - '30'
        is_free:
          type: boolean
        convert_currency:
          type: boolean
        is_encapsulated:
          type: boolean
        has_speed_recovery:
          type: boolean
        attachment_url:
          type:
            - string
            - 'null'
          format: uri
          maxLength: 255
        landing_page:
          type:
            - string
            - 'null'
          format: uri
          maxLength: 255
        support_email:
          type:
            - string
            - 'null'
          format: email
          maxLength: 255
        author:
          type:
            - string
            - 'null'
          maxLength: 255
        shipping_cost:
          type:
            - number
            - 'null'
          minimum: 0
        sku:
          type:
            - string
            - 'null'
          description: |-
            Three fields the source api never accepted, added because the read
            answers them: a product created here would otherwise come back with
            a sku, a trial and a deliverable the caller had no way to set.
          maxLength: 255
        trial_days:
          type:
            - integer
            - 'null'
          enum:
            - '3'
            - '7'
            - '14'
            - '30'
            - null
        deliverable_content:
          type:
            - string
            - 'null'
      required:
        - name
        - description
        - image
        - category_id
        - language_id
        - payment_type
        - price
        - currency
        - type
        - publish_status
        - delivery
        - warranty_time
      title: UpdateApiProductRequest
    ApiProductResource:
      type: object
      properties:
        id:
          type: integer
        seller_id:
          type:
            - integer
            - 'null'
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        price:
          type:
            - string
            - 'null'
        currency:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
        payment_type:
          type:
            - string
            - 'null'
        publish_status:
          type:
            - string
            - 'null'
        is_free:
          type: boolean
        approved:
          type: boolean
        sku:
          type:
            - string
            - 'null'
        recurrence_interval:
          type:
            - string
            - 'null'
        recurrence_interval_count:
          type:
            - integer
            - 'null'
        trial_days:
          type:
            - integer
            - 'null'
        category_id:
          type:
            - integer
            - 'null'
        language_id:
          type:
            - integer
            - 'null'
        image:
          type:
            - string
            - 'null'
          description: |-
            Stored object path (round-tripped on update) and the full URL
            front-v2 renders (AWS_URL prefix + path).
        image_url:
          type:
            - string
            - 'null'
        delivery:
          type:
            - string
            - 'null'
        deliverable_content:
          type:
            - string
            - 'null'
        attachment_url:
          type:
            - string
            - 'null'
        landing_page:
          type:
            - string
            - 'null'
        support_email:
          type:
            - string
            - 'null'
        author:
          type:
            - string
            - 'null'
        warranty_time:
          type:
            - integer
            - 'null'
        shipping_cost:
          type:
            - string
            - 'null'
        is_encapsulated:
          type: boolean
        convert_currency:
          type: boolean
        has_speed_recovery:
          type: boolean
      required:
        - id
        - seller_id
        - name
        - description
        - price
        - currency
        - type
        - payment_type
        - publish_status
        - is_free
        - approved
        - sku
        - recurrence_interval
        - recurrence_interval_count
        - trial_days
        - category_id
        - language_id
        - image
        - image_url
        - delivery
        - deliverable_content
        - attachment_url
        - landing_page
        - support_email
        - author
        - warranty_time
        - shipping_cost
        - is_encapsulated
        - convert_currency
        - has_speed_recovery
      title: ApiProductResource
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A chave de API da conta, no formato `sk_{modo}_{prefixo}.{segredo}`.

````