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

# Atualizar taxas

> Atualiza as taxas aplicadas à subconta. `payment` = MDR; `service` = taxa fixa por transação; `anticipation` = antecipação; `reserved` = reserva financeira.

Regras de combinação type/feeType:
- `payment` → apenas `feeType=percentage` (MDR)
- `service` → apenas `feeType=fixed` (valor fixo por transação)
- `anticipation` e `reserved` → apenas `feeType=percentage`
- `installments` só é aceito quando `paymentMethod=credit`
- `type=payment` + `feeType=fixed` é inválido e responde 400 na validação do payload

## Regras de combinação entre `type` e `feeType`

| `type` | `feeType` permitido | Uso |
| - | - | - |
| `payment` | `percentage` | MDR da transação |
| `service` | `fixed` | Valor fixo por transação |
| `anticipation` | `percentage` | Taxa de antecipação |
| `reserved` | `percentage` | Reserva financeira |

* `installments` só é aceito quando `paymentMethod=credit`.
* Para PIX/débito, não envie `installments`.
* `type=payment` + `feeType=fixed` é inválido e a API responde 400 na validação do payload.

## Exemplo PIX (MDR + taxa fixa)

```json theme={null}
{
  "fees": [
    {
      "type": "payment",
      "feeType": "percentage",
      "feeValue": 699,
      "paymentMethod": "pix"
    },
    {
      "type": "service",
      "feeType": "fixed",
      "feeValue": 249,
      "paymentMethod": "pix"
    }
  ]
}
```


## OpenAPI

````yaml PATCH /v1/submerchants/{internalId}/fees
openapi: 3.0.0
info:
  title: UvviPay Public API
  description: >-
    Endpoints públicos da plataforma UvviPay para integração de subcontas
    (submerchants).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.uvvipay.com.br
    description: Produção
  - url: https://api-staging.uvvipay.com.br
    description: Staging
security:
  - client-id: []
    client-secret: []
tags: []
paths:
  /v1/submerchants/{internalId}/fees:
    patch:
      tags:
        - Submerchants
      summary: Atualizar taxas da subconta
      description: >-
        Atualiza as taxas aplicadas à subconta. `payment` = MDR; `service` =
        taxa fixa por transação; `anticipation` = antecipação; `reserved` =
        reserva financeira.


        Regras de combinação type/feeType:

        - `payment` → apenas `feeType=percentage` (MDR)

        - `service` → apenas `feeType=fixed` (valor fixo por transação)

        - `anticipation` e `reserved` → apenas `feeType=percentage`

        - `installments` só é aceito quando `paymentMethod=credit`

        - `type=payment` + `feeType=fixed` é inválido e responde 400 na
        validação do payload
      operationId: updateFees
      parameters:
        - name: client-secret
          in: header
          description: Secret da credencial do merchant
          required: true
          schema:
            type: string
        - name: client-id
          in: header
          description: ID público da credencial do merchant
          required: true
          schema:
            type: string
        - name: internalId
          required: true
          in: path
          description: Identificador interno (UUID) da subconta
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiUpdateSubMerchantFeesDto'
      responses:
        '200':
          description: Taxas atualizadas com sucesso
        '400':
          description: Taxas inválidas
        '401':
          description: Credenciais inválidas ou ausentes
        '404':
          description: Subconta não encontrada
        '429':
          description: Limite de requisições excedido
components:
  schemas:
    ApiUpdateSubMerchantFeesDto:
      type: object
      properties:
        fees:
          description: Lista de taxas a aplicar (mínimo 1, máximo 100)
          type: array
          items:
            $ref: '#/components/schemas/ApiUpdateSubMerchantFeeItemDto'
      required:
        - fees
    ApiUpdateSubMerchantFeeItemDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - payment
            - service
            - anticipation
            - reserved
          description: >-
            Tipo da taxa: `payment` (MDR percentual da transação), `service`
            (taxa fixa por transação), `anticipation` (antecipação) ou
            `reserved` (reserva financeira).
          example: payment
        paymentMethod:
          type: string
          enum:
            - credit
            - debit
            - pix
          description: Método de pagamento (obrigatório quando type = payment ou service)
          example: credit
        installments:
          type: integer
          description: >-
            Número de parcelas (obrigatório quando paymentMethod = credit; não
            informar para debit/pix)
          minimum: 1
          example: 1
        feeType:
          type: string
          enum:
            - percentage
            - fixed
          description: >-
            Tipo do valor: `percentage` (centésimos de %, ex.: 299 = 2,99%) ou
            `fixed` (centavos, ex.: 100 = R$ 1,00). Combinações válidas:
            `payment`/`anticipation`/`reserved` → `percentage`; `service` →
            `fixed`.
          example: percentage
        feeValue:
          type: integer
          description: >-
            Valor da taxa (inteiro >= 0). Quando `feeType=percentage`, use
            centésimos de ponto percentual (ex.: 299 = 2,99%) e o valor deve ser
            < 10000. Quando `feeType=fixed`, use centavos (ex.: 249 = R$ 2,49).
          minimum: 0
          example: 299
      required:
        - type
        - feeType
        - feeValue
  securitySchemes:
    client-id:
      type: apiKey
      in: header
      name: client-id
    client-secret:
      type: apiKey
      in: header
      name: client-secret

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.