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

# Accept the suggestions

> Accept the suggestions for the bank account transaction. 
This will create a new transaction with the remaining bank transaction amount upto the unpaid invoice amounts.
When the bank transaction has a remaining amount, you can assign that to other invoices.

<sup>Required permissions: `bank-account-transaction:write`</sup>



## OpenAPI

````yaml put /payment/bank-account-transactions/accept-suggestions
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /payment/bank-account-transactions/accept-suggestions:
    parameters: []
    put:
      tags:
        - BankAccountTransaction
      summary: Accept the suggestions
      description: >-
        Accept the suggestions for the bank account transaction. 

        This will create a new transaction with the remaining bank transaction
        amount upto the unpaid invoice amounts.

        When the bank transaction has a remaining amount, you can assign that to
        other invoices.


        <sup>Required permissions: `bank-account-transaction:write`</sup>
      operationId: acceptBankAccountTransactionSuggestions
      parameters: []
      requestBody:
        description: ''
        content: {}
        required: false
      responses:
        '200':
          description: BankAccountTransaction resource updated
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BankAccountTransaction-BankAccountTransactionDetail
            text/html:
              schema:
                $ref: >-
                  #/components/schemas/BankAccountTransaction-BankAccountTransactionDetail
          links: {}
        '400':
          description: Invalid input
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - bank-account-transaction:write
components:
  schemas:
    BankAccountTransaction-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: ad8f0b9c-4b1e-4e0e-8b9c-4b1e4e0e8b9c
          type: string
          description: Unique identifier of the bank account
        suggestedInvoice:
          readOnly: true
          anyOf:
            - $ref: '#/components/schemas/Invoice-BankAccountTransactionDetail'
            - type: 'null'
        suggestedCustomer:
          readOnly: true
          anyOf:
            - $ref: '#/components/schemas/Customer-BankAccountTransactionDetail'
            - type: 'null'
        valueDate:
          type: string
          format: date-time
        bookingDate:
          type: string
          format: date-time
        paymentDate:
          type: string
          format: date-time
        usageDescription:
          example: Kundennummer 1234567890 Rechnung 1234567890
          type: string
        endToEndId:
          example: '1234567890'
          type:
            - string
            - 'null'
        counterParty:
          anyOf:
            - $ref: '#/components/schemas/BankAccount-BankAccountTransactionDetail'
            - type: 'null'
        amount:
          $ref: '#/components/schemas/MoneyEmbedded-BankAccountTransactionDetail'
        fee:
          $ref: '#/components/schemas/MoneyEmbedded-BankAccountTransactionDetail'
          readOnly: true
        status:
          type: string
          enum:
            - STATUS_RECEIVED
            - STATUS_BOOKED
            - STATUS_MANUAL_MATCHING_REQUIRED
            - STATUS_IGNORED
            - outstanding_amount
            - suggestions_available
        receivedAt:
          readOnly: true
          type: string
          format: date-time
        bookedAt:
          readOnly: true
          type:
            - string
            - 'null'
          format: date-time
        mandateId:
          readOnly: true
          example: MAN1234567890
          type:
            - string
            - 'null'
        source:
          readOnly: true
          description: The source of the bank account transaction.
          example: klarna
          enum:
            - klarna
        type:
          description: The type of the bank account transaction.
          example: debit
          enum:
            - debit
            - credit
        transactionCode:
          description: >-
            The transaction code as defined in ISO 20022. See:
            https://www.iso20022.org/sites/default/files/2020-08/BTC_ExternalCodeListDescription_31Aug2020.doc
          example: RCDT
          type:
            - string
            - 'null'
        assignments:
          readOnly: true
          description: >-
            All assignments to invoices and their transactions. Can be one or
            multiple, if the bank transaction was split into multiple invoices.
            Use case: A customer pays multiple invoices with one bank
            transaction.
          type: array
          items:
            $ref: >-
              #/components/schemas/BankAccountTransactionAssignment-BankAccountTransactionDetail
        unassignedAmount:
          $ref: '#/components/schemas/Money-BankAccountTransactionDetail'
          readOnly: true
          description: >-
            The amount that is not assigned to any invoice or transaction. Can
            be negative if the bank transaction is assigned to invoices and
            transactions with a higher amount than the bank transaction amount.
    Invoice-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          description: The unique identifier of the invoice.
          example: 00000000-0000-0000-0000-000000000000
          type: string
          format: uuid
        customer:
          $ref: '#/components/schemas/Customer-BankAccountTransactionDetail'
          description: The customer of the invoice.
        paymentMethod:
          description: >-
            The payment method which should be used to fullfill the payment of
            the invoice.
          anyOf:
            - $ref: '#/components/schemas/PaymentMethod-BankAccountTransactionDetail'
            - type: 'null'
        type:
          description: The type of the invoice.
          example: TYPE_INVOICE
          enum:
            - TYPE_INVOICE
            - TYPE_CREDIT
            - TYPE_REFUND
            - TYPE_REMINDER
            - TYPE_CANCEL
            - TYPE_DUNNING
        currencyCode:
          description: >-
            The currency code of the invoice. If multiple currency codes will be
            used in the positions, they will be converted to that base currency.
          example: EUR
          type: string
        number:
          readOnly: true
          description: >-
            The document id of the invoice. This will be generated, when the
            invoice will be finalized.
          example: RE-0000000001
          type: string
        status:
          readOnly: true
          type: string
          enum:
            - STATUS_DRAFT
            - STATUS_PAID
            - STATUS_CANCELLED
            - STATUS_CLOSED
            - STATUS_REFUNDED
            - STATUS_REMINDED
            - STATUS_UNPAID
            - STATUS_NEW
            - STATUS_FINALIZING
        finalizationDate:
          readOnly: true
          type:
            - string
            - 'null'
          format: date-time
        dueDate:
          type:
            - string
            - 'null'
          format: date-time
        dunningLevel:
          readOnly: true
          type: integer
        dunningStatus:
          readOnly: true
          default: none
          example: none
          type: string
          enum:
            - reminder
            - dunning
            - none
        payDate:
          readOnly: true
          type:
            - string
            - 'null'
          format: date-time
        invoiceAddress:
          readOnly: true
          description: The invoice address of the invoice.
          nullable: true
        internalNote:
          description: The notice of the invoice.
          deprecated: true
          example: This invoice is with a special discount.
          type:
            - string
            - 'null'
        netAmount:
          $ref: '#/components/schemas/MoneyEmbedded-BankAccountTransactionDetail'
          readOnly: true
          description: The net amount of the invoice.
        grossAmount:
          $ref: '#/components/schemas/MoneyEmbedded-BankAccountTransactionDetail'
          readOnly: true
        taxAmount:
          $ref: '#/components/schemas/MoneyEmbedded-BankAccountTransactionDetail'
          readOnly: true
        customFields:
          additionalProperties:
            type: string
          type:
            - object
            - 'null'
          example:
            field1: value1
            field2: value2
          description: >-
            Custom fields for the entity. The keys are the field names and the
            values are the field values. They need to be configured under
            \"/custom-fields\" in the API documentation. The input is validated
            against the configuration. For more details see [Custom Fields
            Guide](/guide/tenant/custom-fields)
        unpaidAmount:
          $ref: '#/components/schemas/Money-BankAccountTransactionDetail'
          readOnly: true
    Customer-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: 00000000-0000-0000-0000-000000000000
          type: string
        customerNumber:
          minLength: 2
          maxLength: 255
          example: CUSTOMER-000
          nullable: false
        timeZone:
          readOnly: true
          default: Europe/Berlin
          example: Europe/Berlin
          type: string
        firstName:
          minLength: 2
          maxLength: 255
          description: Can be empty if the customer is a company.
          example: John
          nullable: true
        lastName:
          minLength: 2
          maxLength: 255
          description: Can be empty if the customer is a company.
          example: Doe
          nullable: true
        currencyCode:
          description: >-
            Can be empty. In this case the default currency of the tenant is
            used.
          externalDocs:
            url: https://schema.org/priceCurrency
          example: EUR
          type: string
        companyName:
          minLength: 2
          maxLength: 255
          example: Acme Inc.
          type:
            - string
            - 'null'
        datevId:
          minLength: 2
          maxLength: 255
          description: The ID of the customer in DATEV
          example: '123456789'
          type:
            - string
            - 'null'
        status:
          default: STATUS_ACTIVE
          example: STATUS_ACTIVE
          enum:
            - STATUS_ACTIVE
            - STATUS_ARCHIVED
            - STATUS_SUSPENDED
    BankAccount-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: ad8f0b9c-4b1e-4e0e-8b9c-4b1e4e0e8b9c
          type: string
          description: Unique identifier of the bank account
        alias:
          example: Girokonto
          type:
            - string
            - 'null'
        iban:
          example: DE12500105170648489890
          type: string
          description: The IBAN of the bank account
        bic:
          example: PBNKDEFFXXX
          type: string
          description: The BIC/SWIFT code of the bank
        accountHolder:
          example: Max Mustermann
          type: string
          description: The name of the account holder
        bankName:
          example: Commerzbank
          type: string
          description: The name of the bank
    MoneyEmbedded-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
    BankAccountTransactionAssignment-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          example: ad8f0b9c-4b1e-4e0e-8b9c-4b1e4e0e8b9c
          type: string
          description: Unique identifier of the bank account
        invoice:
          $ref: '#/components/schemas/Invoice-BankAccountTransactionDetail'
          readOnly: true
        transaction:
          $ref: '#/components/schemas/Transaction-BankAccountTransactionDetail'
        amount:
          $ref: '#/components/schemas/MoneyEmbedded-BankAccountTransactionDetail'
          readOnly: true
        fee:
          $ref: >-
            #/components/schemas/MoneyEmbeddedDefaultNull-BankAccountTransactionDetail
          readOnly: true
        matchedAt:
          readOnly: true
          type: string
          format: date-time
    Money-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
    PaymentMethod-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          type: string
          description: Unique identifier of the payment method
          example: c1a2b3c4-d5e6-4f7a-8b9b-0c1d2e3f4a5b
        gatewayName:
          type: string
          enum:
            - wallet
            - sepa_debit
            - stripe
            - fake_provider
            - paypal
            - bank_transfer
            - go_cardless
            - testing
          description: The payment gateway used to process the payment method
        type:
          type:
            - string
            - 'null'
          enum:
            - sepa_debit
            - card
            - paypal
            - bank_transfer
            - wallet
            - fake_provider
            - null
          description: The type of the payment method
        default:
          type: boolean
          description: Whether this is the default payment method for the customer
          example: true
        status:
          default: active
          example: active
          type: string
          enum:
            - active
            - action_required
            - expired
            - revoked
            - gateway_unconfigured
          description: The current status of the payment method
        enabled:
          type: boolean
          description: Whether the payment method is enabled for use
          example: true
        name:
          type:
            - string
            - 'null'
          description: Display name of the payment method
          example: Visa (4242)
        creationDate:
          readOnly: true
          type: string
          format: date-time
          description: The date when the payment method was created
          example: '2024-01-15T10:30:00+00:00'
        expirationDate:
          type:
            - string
            - 'null'
          format: date-time
          description: The expiration date of the payment method, if applicable
          example: '2026-12-31T23:59:59+00:00'
        card:
          readOnly: true
          description: The card data of the payment method, if the type is "card"
          type: object
          properties:
            brand:
              type: string
              example: Visa
              description: The brand of the card
            last4:
              type: string
              example: '4242'
              description: The last 4 digits of the card
            expMonth:
              type: integer
              example: 12
              description: The expiration month of the card
            expYear:
              type: integer
              example: 2022
              description: The expiration year of the card
            cardHolder:
              type: string
              example: Max Mustermann
              description: The card holder name
        sepaDebit:
          readOnly: true
          description: >-
            The sepa mandate data of the payment method, if the type is
            "sepa_debit"
          type: object
          properties:
            iban:
              type: string
              example: DE8937*********3232
              description: The iban of the sepa mandate
            bic:
              type: string
              example: COBADEFFXXX
              description: The bic of the sepa mandate
            mandateReference:
              type: string
              example: MNDT-2021-123456
              description: The mandate reference of the sepa mandate
            signingDate:
              type: string
              example: '2021-01-01T00:00:00+00:00'
              description: The signing date of the sepa mandate
        paypal:
          readOnly: true
          description: The paypal data of the payment method, if the type is "paypal"
          type: object
          properties:
            email:
              type: string
              example: max@mustermann.de
              description: The email of the paypal account
            billingAgreementId:
              type: string
              example: I-1J5gqz2eZvKYlo2C2X2X2X2X
              description: The billing agreement id of the paypal account
    Transaction-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b
          type: string
        type:
          readOnly: true
          default: payment
          example: payment
          type: string
          enum:
            - payment
            - refund
        status:
          readOnly: true
          description: |-
            The status of the transaction.

            Possible values:
             * `new`: The transaction is new and not yet processed. A new transaction is created when a payment is initiated.
             * `authorized`: The transaction is authorized and can be captured.
             * `authorizing`: The transaction is authorizing. No actions can be performed on the transaction.
             * `waiting`: The transaction is waiting for a response from the payment provider, or a customer input. No actions can be performed on the transaction.
             * `offsite_authorization_required`: The transaction requires an offsite authorization, e.g. 3D Secure. The customer is informed about the required authorization and redirected to the payment provider.
             * `booked`: The transaction is captured and booked on the account.
             * `captured`: The transaction is captured and will be booked on the account.
             * `dispute`: The transaction is disputed.
             * `manual`: Legacy status. Do not use.
             * `canceled`: The transaction is canceled, e.g. by the customer during the payment process, or by the merchant.
             * `pending`: The transaction is pending, and will be processed soon by the payment provider.
             * `expired`: The transaction is expired, e.g. because the customer did not complete the payment process in time.
             * `processing`: The transaction is processing, e.g. because the payment provider is currently processing the payment.
             * `failed`: The transaction failed, e.g. because the payment provider could not process the payment.
             * `unknown`: The transaction status is unknown.
             * `refunded`: The transaction is fully refunded.
             * `payedout`: The transaction was a payout.
             * `partial_refunded`: The transaction is partially refunded.
             * `refund_failed`: The transaction refund failed.
          example: new
        description:
          readOnly: true
          description: The description of the transaction.
          example: 'Payment for invoice #123'
          type: string
        documentNumber:
          readOnly: true
          description: The internal reference number of the transaction.
          example: '123456789'
          type: string
        currencyCode:
          $ref: '#/components/schemas/CurrencyCode-BankAccountTransactionDetail'
          readOnly: true
          description: The currency code of the transaction.
          example: EUR
        amount:
          readOnly: true
          description: The original amount which was requested.
          example: 500
          type: integer
        refundedAmount:
          readOnly: true
          description: The amount which was refunded.
          type: integer
        chargedAmount:
          readOnly: true
          description: The amount which was charged to the payment method.
          example: 500
          type: integer
        feeAmount:
          readOnly: true
          description: The amount of the transaction fee.
          example: 50
          type:
            - integer
            - 'null'
        createdAt:
          readOnly: true
          description: The date when the transaction was created.
          type: string
          format: date-time
        paidAt:
          readOnly: true
          description: The date when the transaction was charged.
          type:
            - string
            - 'null'
          format: date-time
    MoneyEmbeddedDefaultNull-BankAccountTransactionDetail:
      type: object
      description: ''
      deprecated: false
    CurrencyCode-BankAccountTransactionDetail:
      type: string
      description: ISO 4217 currency code.
      example: EUR
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````