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

# Reverse and delete an account transfer.

> D5b: DELETE always reverses the transfer's effect on both accounts (soft delete + balance reversal in the same database transaction). The response includes the two resulting balances, same as POST, so the front can update the screen without a refetch. A transfer already reversed responds 409.



## OpenAPI

````yaml /openapi/extat-openapi.json delete /companies/transfers/{id}
openapi: 3.0.0
info:
  contact:
    email: contato@cernedigital.io
    name: Cerne Digital
    url: https://cernedigital.io
  description: >-
    API REST da Extat Plataforma usada pelo painel web. Artefato OpenAPI 3.0
    para a documentação Mintlify (tags em PT-BR).
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Extat Plataforma - API REST
  version: '1.0'
servers:
  - url: https://golang-api-vgnqx.ondigitalocean.app/v1
security: []
tags:
  - name: Autenticação
  - name: Bancos
  - name: Contas Bancárias
  - name: Plano e Assinaturas
  - name: Empresa
  - name: Centros de Custo
  - name: Painel
  - name: Demonstrativos
  - name: Saúde
  - name: Convites
  - name: Membros
  - name: Onboarding
  - name: Fornecedores
  - name: Usuário
paths:
  /companies/transfers/{id}:
    delete:
      tags:
        - Empresa
      summary: Reverse and delete an account transfer.
      description: >-
        D5b: DELETE always reverses the transfer's effect on both accounts (soft
        delete + balance reversal in the same database transaction). The
        response includes the two resulting balances, same as POST, so the front
        can update the screen without a refetch. A transfer already reversed
        responds 409.
      parameters:
        - description: company uuid
          in: header
          name: x-company-id
          required: true
          schema:
            type: string
        - description: Transfer ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/account_transfer.AccountTransferResponseDTO
          description: transfer reversed; reversed_at filled, balances reflect the reversal
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: invalid x-company-id
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: transfer does not belong to the informed company
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: transfer not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: transfer already reversed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    account_transfer.AccountTransferResponseDTO:
      properties:
        amount:
          type: string
        amount_value:
          type: number
        created_at:
          type: string
        created_by:
          type: object
        destination_account:
          type: object
        destination_balance:
          type: number
        id:
          type: string
        more_infos:
          type: string
        origin_account:
          type: object
        origin_balance:
          description: >-
            OriginBalance/DestinationBalance só vêm preenchidos na resposta de

            criação (201/200 do POST) e de estorno (DELETE) — plan.md: "a
            resposta

            inclui os saldos resultantes das duas contas, para o front atualizar
            a

            tela sem refetch". GetByID/GetAll/PATCH não carregam efeito de saldo

            nenhum, então ficam de fora (omitempty) para não sugerir um refetch
            de

            saldo que a operação não fez.
          type: number
        reference:
          type: string
        reversed_at:
          description: >-
            ReversedAt só aparece (ponteiro não-nil) quando a transferência foi

            estornada (D5b) — inclusive no replay idempotente pós-estorno (T4b):
            o

            handler responde 200 e o cliente vê, pelo campo preenchido, que
            aquela

            chave já havia sido usada e a transferência desfeita.
          type: string
        transfer_date:
          type: string
        type:
          type: string
        updated_at:
          type: string
      type: object
    handler.ErrorResponseDTO:
      properties:
        error:
          type: string
        message:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Token da sessão no cabeçalho Authorization, no formato Bearer (mesmo
        esquema ApiKeyAuth do contrato).
      in: header
      name: Authorization
      type: apiKey

````