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

# Transfer balance from account to account

> Please note that this feature requires manual configuration. If you want to use it, please contact your CSM.

This operation enables transfer of balance from account A to account B. The balance is debited from the fromAccount and credited to the toAccount. The request will create two separate account level transactions, one debiting and one crediting that are visible in respective accounts.

The transactionType codes for the transactions are:

•`A2AD` for the debiting transaction

•`A2AC` for the crediting transaction

The transactions are posted in a consecutive manner, first the debiting transaction followed by the crediting transaction. If either accountId is invalid, either account status prevents posting of transactions or if the available balance in the fromAcccount is not sufficient, the operation will fail. If the first debiting transaction fails, the process will be discontinued, and the crediting transaction will not be performed (`status`: `DEBIT_FAILED`). If the debiting transaction is successful but the crediting transaction fails, the debiting transaction will be automatically reversed (`status`: `FAILED_BUT_REVERSED`).




## OpenAPI

````yaml transfer post /v1/a2a
openapi: 3.0.3
info:
  version: '1'
  title: Transfer API
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/transfer
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/transfer
    description: Live environment
security: []
tags:
  - name: Account to account batch transfer
paths:
  /v1/a2a:
    post:
      tags:
        - Post account to account transfer
      summary: Transfer balance from account to account
      description: >
        Please note that this feature requires manual configuration. If you want
        to use it, please contact your CSM.


        This operation enables transfer of balance from account A to account B.
        The balance is debited from the fromAccount and credited to the
        toAccount. The request will create two separate account level
        transactions, one debiting and one crediting that are visible in
        respective accounts.


        The transactionType codes for the transactions are:


        •`A2AD` for the debiting transaction


        •`A2AC` for the crediting transaction


        The transactions are posted in a consecutive manner, first the debiting
        transaction followed by the crediting transaction. If either accountId
        is invalid, either account status prevents posting of transactions or if
        the available balance in the fromAcccount is not sufficient, the
        operation will fail. If the first debiting transaction fails, the
        process will be discontinued, and the crediting transaction will not be
        performed (`status`: `DEBIT_FAILED`). If the debiting transaction is
        successful but the crediting transaction fails, the debiting transaction
        will be automatically reversed (`status`: `FAILED_BUT_REVERSED`).
      operationId: postAccountToAccountTransfer
      parameters:
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/accountToAccountTransferRequest'
      responses:
        '201':
          description: Transfer created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transferResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          description: API is having problems
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      deprecated: false
components:
  requestBodies:
    accountToAccountTransferRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/accountToAccountTransferRequest'
      description: The fields that you want to apply to your transfer
      required: true
  schemas:
    transferResponse:
      type: object
      required:
        - status
      properties:
        id:
          type: string
          description: >-
            Enfuce generated id for transfer. Id is recorded to the add_info
            fields in the crediting and debiting transactions as reference
            (available in Data export transaction files).
        creditTransaction:
          $ref: '#/components/schemas/transactionInfo'
        debitTransaction:
          $ref: '#/components/schemas/transactionInfo'
        reversalTransaction:
          $ref: '#/components/schemas/transactionInfo'
        status:
          type: string
          enum:
            - COMPLETED
            - FAILED_BUT_REVERSED
            - DEBIT_FAILED
            - FAILED_BUT_NOT_REVERSED
          description: >-
            Final transfer status. `COMPLETED` - succsessfully completed
            transfer, debitTransaction and creditTransaction info will be
            returned. `DEBIT_FAILED` - failed to do debit transaction, aborting
            transfer. Failed debit transaction id will be returned.
            `FAILED_BUT_REVERSED` - failed to transfer money, but reversed debit
            transaction. Debit, credit and reversal info will be returned.
            `FAILED_BUT_NOT_REVERSED` - unexpected error. Debit part done,
            crediting - failed, and failed to reverse debit. Manual interaction
            is required to fix.
      title: transferResponse
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    accountToAccountTransferRequest:
      type: object
      required:
        - fromAccountId
        - toAccountId
        - amount
        - currency
      properties:
        fromAccountId:
          type: string
          format: biginteger
          description: Id of account from which balance will be debited
        toAccountId:
          type: string
          format: biginteger
          description: Id of account from which balance will be credited
        amount:
          type: number
          description: >-
            Transfer amount. It is possible to post only amount which is equal
            or more than minimal currency unit (For example, for EUR, SEK, NOK
            minimal unit is 0,01)
        currency:
          type: string
          description: >-
            Currency of the amount in ISO 4217 (Alpha code) format. Currency has
            to be the same as account currency. Balance transfer can only be
            done between accounts that are in the same currency, i.e. currency
            conversion is not supported.
          pattern: '[A-Z]{3}'
          example: EUR
        text:
          type: string
          maxLength: 255
          description: >-
            Free form text. Text is available in Transaction API as well as Data
            export transaction files.
      title: AccountToAccountTransferRequest
    transactionInfo:
      type: object
      properties:
        id:
          type: string
          format: biginteger
          description: transaction id
        errorMessage:
          type: string
          description: Contains short description of error if happened

````