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

# Update a transaction for a bank account



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json put /v1/bank-accounts/{accountId}/transactions/{transactionId}
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/bank-accounts/{accountId}/transactions/{transactionId}:
    put:
      tags:
        - AccountTransaction
      summary: Update a transaction for a bank account
      operationId: accountTransaction.update
      parameters:
        - name: accountId
          in: path
          required: true
          description: The bank account identifier
          schema:
            type: integer
        - name: transactionId
          in: path
          required: true
          description: The transaction identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountTransactionUpdateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/AccountTransactionResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        const: Account transaction not found
                    required:
                      - message
                required:
                  - success
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    AccountTransactionUpdateRequest:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AccountTransactionType'
          description: The type.
        debit:
          type: number
          description: Debit amount.
          minimum: 0
        credit:
          type: number
          description: Credit amount.
          minimum: 0
        currency_id:
          type: integer
          description: The currency ID.
        exchange_rate:
          type: number
          description: Currency exchange rate.
          minimum: 0
        transaction_date:
          type: string
          format: date-time
          description: Transaction date (YYYY-MM-DD).
        payment_method:
          $ref: '#/components/schemas/PaymentMethod'
          description: The payment method.
        description:
          type:
            - string
            - 'null'
          description: The description.
          maxLength: 65535
        invoice_number:
          type:
            - string
            - 'null'
          description: Invoice number.
          maxLength: 255
      title: AccountTransactionUpdateRequest
    AccountTransactionResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type:
            - integer
            - 'null'
        batch_uuid:
          type:
            - string
            - 'null'
        account_id:
          type: integer
        account:
          $ref: '#/components/schemas/RelatedAccountResource'
        currency_id:
          type:
            - integer
            - 'null'
        currency:
          $ref: '#/components/schemas/RelatedCurrencyResource'
        exchange_rate:
          type: number
        debit:
          type: string
        credit:
          type: string
        amount:
          type: string
        transaction_date:
          type: string
          format: date-time
        type:
          type: string
        payment_method:
          type: string
        description:
          type:
            - string
            - 'null'
        invoice_number:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - tenant_id
        - batch_uuid
        - account_id
        - currency_id
        - exchange_rate
        - debit
        - credit
        - amount
        - transaction_date
        - type
        - payment_method
        - description
        - invoice_number
        - created_at
        - updated_at
      title: AccountTransactionResource
    AccountTransactionType:
      type: string
      enum:
        - collection
        - payment
        - transfer
        - bank_commission
        - opening_balance
      title: AccountTransactionType
    PaymentMethod:
      type: string
      enum:
        - bank_account
        - transfer_cash
        - other
        - clinic_credit_card
        - credit_card
        - private_insurance
        - sgk
      title: PaymentMethod
    RelatedAccountResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
      title: RelatedAccountResource
    RelatedCurrencyResource:
      type: object
      properties:
        id:
          type: integer
        code:
          type:
            - string
            - 'null'
        symbol:
          type:
            - string
            - 'null'
        name:
          type: string
      required:
        - id
        - code
        - symbol
        - name
      title: RelatedCurrencyResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    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:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````