> ## 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 a financial entry

> Create a new financial entry (Bank or Cash operation)



## OpenAPI

````yaml post /consumers/{consumer_id}/accounting/financial-entries
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/financial-entries:
    post:
      tags:
        - Accounting
        - Journal entries
      summary: Create a financial entry
      description: Create a new financial entry (Bank or Cash operation)
      operationId: accounting_create_financial_entries
      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.
        - name: financial_counterpart_account
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Financial Counterpart Account
          description: >-
            Number of ledger account representing bank account in accounting.
            Required in cases where the connector does not allow direct linking
            of the ledger account representing the bank account and the journal
            representing the bank account, making it necessary to specify it
            here.
        - name: force_currency_exchange
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            default: false
            title: Force Currency Exchange
          description: >-
            Boolean flag indicating whether to force the use of the provided
            currency exchange rate instead of the rate used by the accounting
            software. 
        - name: ignore_accounting_id
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Ignore Accounting Id
          description: >-
            If set to true, Chift will not wait for the entry to be processed to
            return, use this when you do not need the ID in the return
            value.Note that this might also change the output of the call.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FinancialEntryItemIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinancialEntryItemOut'
        '400':
          content:
            application/json:
              examples:
                Invalid Journal Id:
                  value:
                    message: The format of the journal_id doesn't seem to be correct.
                    status: error
                No items:
                  value:
                    message: Please add at least one item.
                    status: error
                Journal wrong scope:
                  value:
                    message: >-
                      The given journal cannot be used with this type of
                      operation.
                    status: error
                Account wrong scope:
                  value:
                    message: The account 'x' cannot be used for this type of line.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              examples:
                Journal not found:
                  value:
                    message: The journal doesn't exist in the accounting system.
                    status: error
                Partner not found:
                  value:
                    message: >-
                      The client/supplier/employee doesn't exist in the
                      accounting system.
                    status: error
                Account not found:
                  value:
                    message: >-
                      The account number 'x' doesn't exist in the accounting
                      system.
                    status: error
                Currency not found:
                  value:
                    message: The currency 'x' doesn't exist in the accounting system.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - mcp_auth:
            - accounting
            - accounting.journal_entries
components:
  schemas:
    FinancialEntryItemIn:
      properties:
        date:
          type: string
          format: date
          title: Date
          description: >-
            Accounting date of the financial entry (format: YYYY-MM-DD). This is
            the date when the financial entry is recorded in the accounting
            system.
        journal_id:
          type: string
          title: Journal Id
          description: >-
            Id of the journal instance in the accounting system in which the
            financial entry is recorded.
        currency:
          type: string
          title: Currency
          description: Indicates the currency of the operation (e.g., EUR, USD).
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: >-
            Indicates the exchange rate at the date of the operation. Must be
            filled in when creating the operation in another currency from the
            folder's default currency.
          default: 1
        reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference
          description: >-
            Optional reference field that can be used for lettering by storing
            an external or contextual identifier related to the entry . For
            example, it can be used to store a reference number, such as the
            invoice number associated with the payment.
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
          description: >-
            Unique 'number' of the financial entry in the accounting software.
            This is an internal number or identifier assigned to the financial
            entry. It is recommended to use this number for idempotency to
            prevent duplicate entries. Refer to the idempotency documentation in
            the Developer Guides for more details.
        items:
          items:
            $ref: '#/components/schemas/FinancialEntryLineItem'
          type: array
          minItems: 1
          title: Items
        pdf:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdf
          description: >-
            Base 64 string representing the PDF attached to the sale/purchase
            entry.
        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.
      type: object
      required:
        - date
        - journal_id
        - currency
        - items
      title: FinancialEntryItemIn
    FinancialEntryItemOut:
      properties:
        date:
          type: string
          format: date
          title: Date
          description: >-
            Accounting date of the financial entry (format: YYYY-MM-DD). This is
            the date when the financial entry is recorded in the accounting
            system.
        journal_id:
          type: string
          title: Journal Id
          description: >-
            Id of the journal instance in the accounting system in which the
            financial entry is recorded.
        currency:
          type: string
          title: Currency
          description: Indicates the currency of the operation (e.g., EUR, USD).
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: >-
            Indicates the exchange rate at the date of the operation. Must be
            filled in when creating the operation in another currency from the
            folder's default currency.
          default: 1
        reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference
          description: >-
            Optional reference field that can be used for lettering by storing
            an external or contextual identifier related to the entry . For
            example, it can be used to store a reference number, such as the
            invoice number associated with the payment.
        id:
          type: string
          title: Id
          description: Unique id of the financial entry instance in the accounting system.
        number:
          type: string
          title: Number
          description: >-
            Unique 'number' of the financial entry in the accounting software.
            This is an internal number or identifier assigned to the financial
            entry. It is recommended to use this number for idempotency to
            prevent duplicate entries. Refer to the idempotency documentation in
            the Developer Guides for more details.
        items:
          items:
            $ref: '#/components/schemas/FinancialEntryLineItemOut'
          type: array
          title: Items
      type: object
      required:
        - date
        - journal_id
        - currency
        - id
        - number
        - items
      title: FinancialEntryItemOut
    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'
    FinancialEntryLineItem:
      properties:
        account_type:
          $ref: '#/components/schemas/EntryLineType'
          description: >-
            account_type can be either general ('general_account') or thirdparty
            ('customer', 'supplier' or 'employee')
        account:
          type: string
          minLength: 1
          title: Account
          description: >-
            Depending on account_type, if the account_type is 'general_account',
            this is the general ledger account number used to book the journal
            item against. If the account_type is 'customer_account',
            'supplier_account' or 'employee_account', this is the thirdparty_id
            (id of the customer, supplier or employee in the accounting system).
        amount:
          type: number
          title: Amount
          description: >-
            A positive value represents funds received in the bank or cash
            account (i.e., the bank/cash account is debited and the specified
            account_number is credited). A negative value represents funds
            leaving the bank/cash account.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >-
            Text description for this line item. This is typically used to
            provide additional context or information.
        tax_info:
          anyOf:
            - $ref: '#/components/schemas/TaxInfo'
            - type: 'null'
          description: >-
            Tax information related to the financial entry line item. The
            provided tax amount is added to the amount of the line item. This is
            only supported for general accounts.
        automated_matching_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Automated Matching Number
          description: >-
            Automated matching number of the financial entry line item. This is
            used to let the accounting system do an automated matching based on
            this value. This is not supported on all accounting systems.
      type: object
      required:
        - account_type
        - account
        - amount
      title: FinancialEntryLineItem
    FinancialEntryLineItemOut:
      properties:
        account_type:
          $ref: '#/components/schemas/EntryLineType'
          description: >-
            account_type can be either general ('general_account') or thirdparty
            ('customer', 'supplier' or 'employee')
        account:
          type: string
          minLength: 1
          title: Account
          description: >-
            Depending on account_type, if the account_type is 'general_account',
            this is the general ledger account number used to book the journal
            item against. If the account_type is 'customer_account',
            'supplier_account' or 'employee_account', this is the thirdparty_id
            (id of the customer, supplier or employee in the accounting system).
        amount:
          type: number
          title: Amount
          description: >-
            A positive value represents funds received in the bank or cash
            account (i.e., the bank/cash account is debited and the specified
            account_number is credited). A negative value represents funds
            leaving the bank/cash account.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >-
            Text description for this line item. This is typically used to
            provide additional context or information.
        tax_info:
          anyOf:
            - $ref: '#/components/schemas/TaxInfo'
            - type: 'null'
          description: >-
            Tax information related to the financial entry line item. The
            provided tax amount is added to the amount of the line item. This is
            only supported for general accounts.
        automated_matching_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Automated Matching Number
          description: >-
            Automated matching number of the financial entry line item. This is
            used to let the accounting system do an automated matching based on
            this value. This is not supported on all accounting systems.
        counterpart_account:
          type: string
          title: Counterpart Account
      type: object
      required:
        - account_type
        - account
        - amount
        - counterpart_account
      title: FinancialEntryLineItemOut
    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
    EntryLineType:
      type: string
      enum:
        - customer_account
        - supplier_account
        - employee_account
        - general_account
      title: EntryLineType
    TaxInfo:
      properties:
        tax_code:
          type: string
          title: Tax Code
          description: >-
            VAT code of the tax line. This is the Id of the Tax code instance in
            the accounting software.
        tax_amount:
          type: number
          title: Tax Amount
          description: >-
            Amount of the tax line. The amount must be positive and is required
            even with reversed VAT.
        vat_account:
          anyOf:
            - type: string
            - type: 'null'
          title: Vat Account
          description: >-
            VAT ledger account of the tax line. This is the ledger account
            number used to book the tax amount. The account is mandatory if tax
            amount is different from 0. The ledger account will ONLY be used
            when it is mandatory to pass this information to the accounting
            software.
        reversed_vat_account:
          anyOf:
            - type: string
            - type: 'null'
          title: Reversed Vat Account
          description: >-
            Reversed VAT ledger account of the tax line. This is the ledger
            account number used to book the reversed tax amount. The account is
            mandatory if you are using a reversed VAT code. The ledger account
            will ONLY be used when it is mandatory to pass this information to
            the accounting software.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional extra description of the tax line.
      type: object
      required:
        - tax_code
        - tax_amount
      title: TaxInfo
  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.

````