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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Reverter transferência avulsa

> Reverte total ou parcialmente uma transferência avulsa da plataforma para o destinatário

Reverta total ou parcialmente uma transferência `PLATFORM_TO_RECIPIENT`, de acordo com o status dela e o valor reversível restante.

Uma transferência original `RECIPIENT_TO_PLATFORM` não pode ser revertida: as requisições de reversão total e parcial retornam `400 INVALID_PARAMETERS`. Para devolver uma tarifa cobrada separadamente, [crie uma nova transferência](https://docs.y.uno/pt-br/reference/transfers/create-standalone-transfer.md) com `direction: PLATFORM_TO_RECIPIENT`.

A resposta HTTP da reversão descreve a transferência original após a reversão e não inclui `direction`. Use [GET](https://docs.y.uno/pt-br/reference/transfers/get-standalone-transfer.md) para ler a direção da transferência original, que não muda. A notificação de reversão inclui a direção `PLATFORM_TO_RECIPIENT` da transferência original.


## OpenAPI

````yaml openapi/pt-br/transfers/reverse-standalone-transfer.json POST /split-marketplace/transfers/{transfer_id}/reverse
openapi: 3.1.0
info:
  title: Transfer Flow API
  version: 1.0.0
  description: >-
    API for managing standalone forward and reverse transfers within the
    Marketplace.
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - public_api_key: []
    private_secret_key: []
paths:
  /split-marketplace/transfers/{transfer_id}/reverse:
    post:
      tags:
        - Transfers
      summary: Reverter transferência avulsa
      description: >-
        Reverte total ou parcialmente uma transferência PLATFORM_TO_RECIPIENT.
        Uma transferência original RECIPIENT_TO_PLATFORM retorna 400
        INVALID_PARAMETERS. Para devolver uma tarifa cobrada separadamente, crie
        uma nova transferência PLATFORM_TO_RECIPIENT. A resposta HTTP da
        reversão não inclui a direção; consulte a transferência original para
        obtê-la.
      operationId: reverse-standalone-transfer
      parameters:
        - name: transfer_id
          in: path
          required: true
          schema:
            type: string
          description: O ID único do fluxo de transferência a ser revertido.
        - name: X-Idempotency-Key
          in: header
          required: true
          schema:
            type: string
          description: Chave única para a idempotência da requisição.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_id
                - reason
              properties:
                account_id:
                  type: string
                  description: O identificador único da conta.
                amount:
                  $ref: '#/components/schemas/Amount'
                reason:
                  type: string
                  description: >-
                    O motivo da reversão. Obrigatório: a API retorna 400
                    INVALID_PARAMETERS ("The field 'reason' is required.")
                    quando ele está ausente.
                description:
                  type: string
                  description: Uma descrição legível para a reversão.
                merchant_reference:
                  type: string
                  description: Identificador único do lojista para rastrear esta reversão.
            examples:
              Reverse a transfer:
                value:
                  account_id: '{{account-code}}'
                  reason: Order cancelled by the customer
                  description: Reversal of transfer
                  merchant_reference: MR-REVERSAL-001
      responses:
        '201':
          description: Reversão processada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReverseTransfer'
              examples:
                PartialReversal:
                  summary: Parent after a partial reversal
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440000
                    recipient_id: d246d578-266c-47c3-92b6-1748d780711b
                    amount:
                      currency: USD
                      value: 1
                    status: REVERSED_PARTIAL
                    reason: ORDER_CANCELLED
                    description: Partial reversal
                    merchant_reference: REVERSAL-001
                    provider_data:
                      id: STRIPE
                      recipient_id: acct_example
                      transaction_id: trr_example
                      response_code: ''
                      response_message: ''
                    transactions:
                      - code: cb5fd244-90fd-49b0-a160-a9d9f764eb9e
                        type: SPLIT_TRANSFER
                        status: SUCCEEDED
                        provider_transfer_id: tr_example
                        created_at: '2026-09-15T10:00:00Z'
                        updated_at: '2026-09-15T10:00:00Z'
                      - code: 0e5b4d60-4811-4a48-90c1-398d28dbce8c
                        type: SPLIT_TRANSFER_REVERSE
                        status: SUCCEEDED
                        parent_transaction_code: cb5fd244-90fd-49b0-a160-a9d9f764eb9e
                        provider_transfer_id: trr_example
                        reason: ORDER_CANCELLED
                        created_at: '2026-09-15T10:05:00Z'
                        updated_at: '2026-09-15T10:05:00Z'
                    created_at: '2026-09-15T10:00:00Z'
                    updated_at: '2026-09-15T10:05:00Z'
        '400':
          description: Requisição inválida
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              examples:
                TRANSFER_NOT_REVERSIBLE:
                  summary: Transfer not reversible
                  value:
                    code: TRANSFER_NOT_REVERSIBLE
                    messages:
                      - The transfer is not in a reversible state.
                TRANSFER_ALREADY_REVERSED:
                  summary: Transfer already reversed
                  value:
                    code: TRANSFER_ALREADY_REVERSED
                    messages:
                      - The transfer has already been reversed.
                REVERSAL_AMOUNT_EXCEEDS:
                  summary: Reversal amount exceeds original
                  value:
                    code: REVERSAL_AMOUNT_EXCEEDS
                    messages:
                      - >-
                        The reversal amount exceeds the original transfer
                        amount.
                INVALID_CURRENCY:
                  summary: Invalid currency
                  value:
                    code: INVALID_CURRENCY
                    messages:
                      - >-
                        The specified currency is invalid or does not match the
                        original transfer.
                DIRECTION_NOT_REVERSIBLE:
                  summary: Recipient-to-platform transfers cannot be reversed
                  description: Match on code. The message text can differ between releases.
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - Invalid transfer parameters
        '404':
          description: Não encontrado
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              examples:
                TRANSFER_NOT_FOUND:
                  summary: Transfer not found
                  value:
                    code: TRANSFER_NOT_FOUND
                    messages:
                      - The specified transfer was not found.
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              examples:
                PROVIDER_INTERNAL_ERROR:
                  summary: Provider internal error
                  value:
                    code: PROVIDER_INTERNAL_ERROR
                    messages:
                      - The payment provider encountered an internal error.
components:
  schemas:
    Amount:
      type: object
      required:
        - value
        - currency
      properties:
        value:
          type: number
          example: 150
        currency:
          type: string
          example: USD
    ReverseTransfer:
      type: object
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        recipient_id: e1b0496e-3049-4ce5-ac89-6ff871becd1b
        amount: e82e476b-f067-42de-8183-16235a0d7253
        status:
          type: string
          example: REVERSED_PARTIAL
        reason: 16eb3268-f98e-475c-bc7c-73a00378bd57
        description: 6562ede4-f054-467f-86f0-7e0564eb3f91
        merchant_reference: 87431d34-1dbc-4ef4-8c49-801da3c365c0
        provider_data:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            recipient_id:
              type: string
            transaction_id:
              type: string
            response_code:
              type: string
            response_message:
              type: string
        created_at: 5daa12cc-e8f2-42ea-badc-df842b9fef22
        updated_at: b7972d30-21ee-4bf3-bede-1ba4a7dbbef9
        transactions: 6afe7c71-5505-4f86-b19c-243c83d615a1
      description: >-
        A transferência original após uma reversão. A direção está disponível
        por meio do GET, não nesta resposta.
  securitySchemes:
    public_api_key:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
    private_secret_key:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY

````

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