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

# Alterar preço do produto

> Define um novo valor, na moeda enviada ou na que o produto já carrega. Um produto de outra conta responde `404`. Um produto sem moeda gravada, chamado sem `currency`, responde `422`: a API não adivinha em que moeda o comprador será cobrado. Exige o escopo `products:write` e o header `Idempotency-Key`.



## OpenAPI

````yaml /apps/seller/openapi.json patch /public/products/{id}/price
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}/price:
    patch:
      tags:
        - Produtos
      summary: Alterar preço do produto
      description: >-
        Define um novo valor, na moeda enviada ou na que o produto já carrega.
        Um produto de outra conta responde `404`. Um produto sem moeda gravada,
        chamado sem `currency`, responde `422`: a API não adivinha em que moeda
        o comprador será cobrado. Exige o escopo `products:write` e o header
        `Idempotency-Key`.
      operationId: publicapi.products.price
      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/UpdateApiProductPriceRequest'
      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:
    UpdateApiProductPriceRequest:
      type: object
      description: >-
        Body of PATCH /v2/public/products/{id}/price: a new amount, and
        optionally the

        currency to state it in.


        The currency is optional because the source api made it optional (SHA

        70cd772): a caller repricing in the currency the product already carries

        should not have to repeat it. The controller supplies the stored
        currency when

        this one is absent, which is why the Money is not built here.
      properties:
        price:
          type: number
          minimum: 0
        currency:
          type:
            - string
            - 'null'
          enum:
            - brl
            - usd
            - eur
            - null
      required:
        - price
      title: UpdateApiProductPriceRequest
    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}`.

````