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

# Create bank transactions

> Create new bank transactions



## OpenAPI

````yaml post /consumers/{consumer_id}/accounting/bank-transactions
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/accounting/bank-transactions:
    post:
      tags:
        - Accounting
        - Bank transactions
      summary: Create bank transactions
      description: Create new bank transactions
      operationId: accounting_create_bank_transactions
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
        - name: folder_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Folder Id
          description: >-
            Id of the accounting folder instance. A folder represents a legal
            entity within the system. Required when the multiple folders feature
            is enabled.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankStatementItemIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankStatementItemOut'
        '400':
          content:
            application/json:
              example:
                message: >-
                  The format of the bank_statement_id doesn't seem to be
                  correct.
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - mcp_auth:
            - accounting
            - accounting.bank_transactions
components:
  schemas:
    BankStatementItemIn:
      properties:
        bank_statement_date:
          type: string
          format: date
          title: Bank Statement Date
          description: Date of the bank statement
        bank_account_id:
          type: string
          minLength: 1
          title: Bank Account Id
          description: Unique ID of the bank account in the accounting system
        currency:
          type: string
          minLength: 1
          title: Currency
          description: >-
            Currency of the bank statement. This must be the same as the
            currency of the bank account.
        external_bank_statement_id:
          type: string
          minLength: 1
          title: External Bank Statement Id
          description: >-
            External bank statement ID. To be compatible with all software, we
            recommend to use only digits with a maximum length of 10.
        opening_balance:
          anyOf:
            - type: number
            - type: 'null'
          title: Opening Balance
          description: Opening balance of the bank account before the statement
        pdf:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdf
          description: Base64 PDF attachment of the bank statement.
        pdf_name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
              pattern: ^[a-zA-Z0-9\-_ ]{1,196}(?:.pdf)?$
            - type: 'null'
          title: Pdf Name
          description: >-
            A name for the PDF file to be created for accounting software that
            support it.
        items:
          items:
            $ref: '#/components/schemas/BankTransactionItemIn'
          type: array
          title: Items
          description: List of transaction items
      type: object
      required:
        - bank_statement_date
        - bank_account_id
        - currency
        - external_bank_statement_id
        - items
      title: BankStatementItemIn
    BankStatementItemOut:
      properties:
        bank_statement_date:
          type: string
          format: date
          title: Bank Statement Date
          description: Date of the bank statement
        bank_account_id:
          type: string
          minLength: 1
          title: Bank Account Id
          description: Unique ID of the bank account in the accounting system
        currency:
          type: string
          minLength: 1
          title: Currency
          description: >-
            Currency of the bank statement. This must be the same as the
            currency of the bank account.
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Internal bank statement ID generated by the accounting system
        external_bank_statement_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Bank Statement Id
          description: External bank statement ID
        items:
          items:
            $ref: '#/components/schemas/BankTransactionItemOut'
          type: array
          title: Items
          description: List of transaction items with their IDs
      type: object
      required:
        - bank_statement_date
        - bank_account_id
        - currency
        - items
      title: BankStatementItemOut
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
      type: object
      required:
        - message
      title: ChiftError
    HTTPValidationError:
      title: Validation Error
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          default: Validation error
        status:
          title: Status
          type: string
          default: error
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    BankTransactionItemIn:
      properties:
        general_ledger_account:
          anyOf:
            - type: string
            - type: 'null'
          title: General Ledger Account
          description: >-
            Number of the general ledger account to book the transaction
            against.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Transaction description
        external_transaction_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Transaction Id
          description: External transaction ID
        amount:
          type: number
          title: Amount
          description: Total amount including fee and tax
        fee_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Fee Amount
          description: Fee amount
          default: 0
        tax_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Tax Amount
          description: Tax amount
          default: 0
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: Exchange rate applicable at the transaction date
          default: 1
        counterpart:
          anyOf:
            - $ref: '#/components/schemas/BankTransactionCounterpartItem'
            - type: 'null'
          description: Counterpart of the transaction
      type: object
      required:
        - amount
      title: BankTransactionItemIn
    BankTransactionItemOut:
      properties:
        general_ledger_account:
          anyOf:
            - type: string
            - type: 'null'
          title: General Ledger Account
          description: >-
            Number of the general ledger account to book the transaction
            against.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Transaction description
        external_transaction_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Transaction Id
          description: External transaction ID
        amount:
          type: number
          title: Amount
          description: Total amount including fee and tax
        fee_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Fee Amount
          description: Fee amount
          default: 0
        tax_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Tax Amount
          description: Tax amount
          default: 0
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: Exchange rate applicable at the transaction date
          default: 1
        counterpart:
          anyOf:
            - $ref: '#/components/schemas/BankTransactionCounterpartItem'
            - type: 'null'
          description: Counterpart of the transaction
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Internal transaction ID generated by the accounting system
      type: object
      required:
        - amount
      title: BankTransactionItemOut
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    BankTransactionCounterpartItem:
      properties:
        counterpart_type:
          anyOf:
            - $ref: '#/components/schemas/BankTransactionCounterpartType'
            - type: 'null'
          description: Type of the counterpart
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: ID of the counterpart in the accounting system
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the counterpart
          examples:
            - John Doe
        iban:
          anyOf:
            - type: string
            - type: 'null'
          title: Iban
          description: IBAN of the counterpart
          examples:
            - BE61310126985517
        bank_account:
          anyOf:
            - type: string
            - type: 'null'
          title: Bank Account
          description: Bank account number of the counterpart
          examples:
            - '310126985517'
      type: object
      title: BankTransactionCounterpartItem
    BankTransactionCounterpartType:
      type: string
      enum:
        - customer
        - supplier
        - employee
      title: BankTransactionCounterpartType
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````