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

# Patch journal entry

## Field support per integration

<AccordionGroup>
  <Accordion title="Tripletex" icon="https://mintcdn.com/maesn/PAQw41f6NgOfTYHL/logo/tripletex.svg?fit=max&auto=format&n=PAQw41f6NgOfTYHL&q=85&s=d6386c1bc69580729a658d7c4f48fd45" width="26" height="38" data-path="logo/tripletex.svg">
    <Note>
      Use the [Interactive Authentication Flow](/authentication#interactive-authentication-flow) to connect Tripletex. It works for both token types: with an accountant token, the user picks the client company from a list;
      with a regular single-company token, the user's own company is selected automatically and no list is shown. You can also set companyId directly if you already know the client company id (accountant tokens only).
    </Note>

    Supported request parameters:

    <ResponseField name="journal_entry" type="string" required>
      <Expandable title="properties">
        <ResponseField name="currency" type="string">
          Defaults to `NOK` if not provided. When a different currency is used, `exchangeRate` is required.
        </ResponseField>

        <ResponseField name="description" type="string" />

        <ResponseField name="exchangeRate" type="string">
          Required when `currency` is not `NOK`.
        </ResponseField>

        <ResponseField name="isProvisional" type="boolean">
          If set to `false`, the journal entry is posted to the ledger. If `true` or omitted, it remains a draft.

          If the existing journal entry was already posted, it cannot become a draft.
        </ResponseField>

        <ResponseField name="journalLineItems" type="JournalLineItem[]">
          Line items are optional. If not provided, only header fields are updated.

          <Expandable title="properties">
            <ResponseField name="id" type="string">
              The ID of an existing line item to update. If not found or not provided, the line is added as new.
            </ResponseField>

            <ResponseField name="accountId" type="string" required />

            <ResponseField name="debitCreditIndicator" type="enum" required>
              Available options: `DEBIT`, `CREDIT`
            </ResponseField>

            <ResponseField name="description" type="string" />

            <ResponseField name="dimensions" type="Dimension[]">
              <Note>
                Dimensions are only available with Tripletex Pro plans. Maximum 3 dimensions per line.
              </Note>

              <Expandable title="properties">
                <ResponseField name="id" type="string" required />
              </Expandable>
            </ResponseField>

            <ResponseField name="taxRate" type="taxRate">
              <Expandable title="properties">
                <ResponseField name="id" type="string" required />
              </Expandable>
            </ResponseField>

            <ResponseField name="totalGrossAmount" type="number" required>
              Must be a positive number.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="transactionDate" type="string" />

        <ResponseField name="version" type="string" required>
          Required for optimistic locking. Obtain from `GET Journal entry by ID`.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="files" type="file[]">
      Allowed file types: PDF, JPG, PNG, TIFF.
    </ResponseField>
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml PATCH /accounting/journalEntries/{journalEntryId}
openapi: 3.0.0
info:
  title: Maesn unified API
  description: The Maesn unified API description
  version: '1.0'
  contact: {}
servers:
  - url: https://api.maesn.dev
security: []
tags:
  - name: maesn
    description: ''
paths:
  /accounting/journalEntries/{journalEntryId}:
    patch:
      tags:
        - accounting
      operationId: patch JournalEntry
      parameters:
        - name: companyId
          required: false
          in: query
          schema:
            type: string
        - name: environmentName
          in: query
          schema:
            type: string
          required: false
        - name: journalEntryId
          required: true
          in: path
          schema:
            type: string
        - name: X-API-KEY
          description: API key
          in: header
          schema:
            type: string
            example: example value
          required: true
        - name: X-ACCOUNT-KEY
          description: Account key
          in: header
          schema:
            type: string
            example: example value
          required: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    format: binary
                  description: Array of files to upload
                filesPos:
                  type: array
                  items:
                    type: number
                  description: Array of file positions
                journal_entry:
                  $ref: '#/components/schemas/JournalentryRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponseDto'
                  - properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/JournalentryResponseDto'
components:
  schemas:
    JournalentryRequestDto:
      type: object
      properties:
        accountId:
          type: string
          example: d1bfd23-517d-4ec6-b7d4-56f86c7cf246
        accountingPeriodId:
          type: string
          example: 2021-06
        accountingReason:
          type: string
          enum:
            - COMMERCIAL
            - TAX
            - IFRS
            - CALCULATION
            - INDEPENDENT
            - OTHER
          example: COMMERCIAL
        currency:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYR
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EEK
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GQE
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LTL
            - LVL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZM
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLL
            - SOS
            - SRD
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - UYU
            - UZS
            - VEB
            - VND
            - VUV
            - WST
            - XAF
            - XCD
            - XDR
            - XOF
            - XPF
            - YER
            - ZAR
            - ZMK
            - ZWR
          example: EUR
        description:
          type: string
          example: Hotel for dreamforce
        documentId:
          type: string
          example: b5e624e5-fb9e-4836-a443-87a3820f5b48
        exchangeRate:
          type: string
          example: 1,2045
        isProvisional:
          type: boolean
          example: 'false'
        isReversal:
          type: boolean
          example: false
        journalLineItems:
          type: array
          items:
            $ref: '#/components/schemas/createJournalLineItem'
        journalCode:
          type: string
          example: '60'
        journalType:
          type: string
          example: FIN
        'number ':
          type: string
          example: '21900030'
        recordType:
          type: string
          enum:
            - STANDARD
            - CLOSING
            - OPENING
          example: STANDARD
        transactionDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        version:
          type: string
          example: AAAAACnY3os1
    BaseResponseDto:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MetaResponse'
        data:
          oneOf:
            - type: object
            - type: array
    JournalentryResponseDto:
      type: object
      properties:
        id:
          type: string
          example: 8df2df10-0fae-40ad-9d22-f25e5ab0ba23
        accountId:
          type: string
          example: 94fdb7fd-13ae-47a6-8a2a-000e6ddc60d9
        accountingPeriodId:
          type: string
          example: 2021-06
        accountingReason:
          type: string
          enum:
            - COMMERCIAL
            - TAX
            - IFRS
            - CALCULATION
            - INDEPENDENT
            - OTHER
          example: COMMERCIAL
        createdDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        currency:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYR
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EEK
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GQE
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LTL
            - LVL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZM
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLL
            - SOS
            - SRD
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - UYU
            - UZS
            - VEB
            - VND
            - VUV
            - WST
            - XAF
            - XCD
            - XDR
            - XOF
            - XPF
            - YER
            - ZAR
            - ZMK
            - ZWR
          example: EUR
        description:
          type: string
          example: Hotel for dreamforce
        documentId:
          type: string
          example: b5e624e5-fb9e-4836-a443-87a3820f5b48
        files:
          type: array
          items:
            type: string
            example: file1.pdf
        exchangeRate:
          type: string
          example: 1,2045
        isProvisional:
          type: boolean
          example: 'false'
        isReversal:
          type: boolean
          example: false
        journalLineItems:
          type: array
          items:
            $ref: '#/components/schemas/journalLineItem'
        journalCode:
          type: string
          example: '60'
        journalType:
          type: string
          example: FIN
        'number ':
          type: string
          example: '21900030'
        recordType:
          type: string
          enum:
            - STANDARD
            - CLOSING
            - OPENING
          example: STANDARD
        transactionDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        updatedDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        version:
          type: string
          example: AAAAACnY3os1
    createJournalLineItem:
      type: object
      properties:
        id:
          type: string
          example: 123f57fd-13ae-47a6-8a2a-000e6ddc60d9
        accountCode:
          type: string
          example: '4034'
        accountId:
          type: string
          example: 94fdb7fd-13ae-47a6-8a2a-000e6ddc60d9
        accountNumber:
          type: string
          example: '1200'
        currency:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYR
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EEK
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GQE
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LTL
            - LVL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZM
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLL
            - SOS
            - SRD
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - UYU
            - UZS
            - VEB
            - VND
            - VUV
            - WST
            - XAF
            - XCD
            - XDR
            - XOF
            - XPF
            - YER
            - ZAR
            - ZMK
            - ZWR
          example: EUR
        customerId:
          type: string
          example: 782d89b56-13ae-47a6-8a2a-45e6ddc50d9
        debitCreditIndicator:
          type: string
          enum:
            - DEBIT
            - CREDIT
          example: DEBIT
        description:
          type: string
          example: Uitgesteld 21600001 Kantoor 01-01-2021-31-12-2021
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/journalDimension'
        documentId:
          type: string
          example: b5e624e5-fb9e-4836-a443-87a3820f5b48
        documentNumber:
          type: string
          example: '123456789'
        exchangeRate:
          type: number
          example: 1
        supplierId:
          type: string
          example: 998933b56-13ae-47a6-8a32a-45e6ddc50d9
        taxRate:
          $ref: '#/components/schemas/taxRate'
          type: object
        thirdPartyCode:
          type: string
          example: '112233'
        totalGrossAmount:
          description: Gross amount of the line item — net plus tax (including VAT).
          type: number
          example: 1190
        totalNetAmount:
          description: Net amount of the line item — before tax (excluding VAT).
          type: number
          example: 1000
        totalTaxAmount:
          description: Tax (VAT) amount of the line item.
          type: number
          example: 190
    MetaResponse:
      type: object
      properties:
        warnings:
          type: array
          items:
            type: string
            example: Field not used by target system
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
    journalLineItem:
      type: object
      properties:
        id:
          type: string
          example: 123f57fd-13ae-47a6-8a2a-000e6ddc60d9
        accountCode:
          type: string
          example: '4034'
        accountId:
          type: string
          example: da33b47c-98ca-4410-9c59-5db485ecaeb0
        accountNumber:
          type: number
          example: 8200
        'createdDate ':
          type: string
          example: '2021-01-01T00:00:00Z'
        currency:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYR
            - BZD
            - CAD
            - CDF
            - CHF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EEK
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GQE
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LTL
            - LVL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZM
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLL
            - SOS
            - SRD
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - UYU
            - UZS
            - VEB
            - VND
            - VUV
            - WST
            - XAF
            - XCD
            - XDR
            - XOF
            - XPF
            - YER
            - ZAR
            - ZMK
            - ZWR
          example: EUR
        customerId:
          type: string
          example: 782d89b56-13ae-47a6-8a2a-45e6ddc50d9
        debitCreditIndicator:
          type: string
          enum:
            - DEBIT
            - CREDIT
          example: DEBIT
        description:
          type: string
          example: Uitgesteld 21600001 Kantoor 01-01-2021-31-12-2021
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/journalDimension'
        documentId:
          type: string
          example: b5e624e5-fb9e-4836-a443-87a3820f5b48
        documentNumber:
          type: string
          example: '123456789'
        exchangeRate:
          type: number
          example: 1
        supplierId:
          type: string
          example: 998933b56-13ae-47a6-8a32a-45e6ddc50d9
        taxRate:
          $ref: '#/components/schemas/taxRate'
          type: object
        thirdPartyCode:
          type: string
          example: '112233'
        totalGrossAmount:
          description: Gross amount of the line item — net plus tax (including VAT).
          type: number
          example: 1190
        totalNetAmount:
          description: Net amount of the line item — before tax (excluding VAT).
          type: number
          example: 1000
        totalTaxAmount:
          description: Tax (VAT) amount of the line item.
          type: number
          example: 190
        updatedDate:
          type: string
          example: '2021-01-01T00:00:00Z'
    journalDimension:
      type: object
      properties:
        id:
          type: string
          example: efa82f42-fd85-11e1-a21f-0800200c9a33
        categoryName:
          type: string
          example: CostCenter
        code:
          type: string
          example: KD1
        name:
          type: string
          example: Material/Waren
    taxRate:
      type: object
      properties:
        id:
          type: string
          example: 1895b05b-38a6-4a6a-9653-166389894350
        code:
          type: string
          example: '03'
        name:
          type: string
          example: Tax19
        taxRatePercentage:
          type: string
          example: '19'
    PaginationResponse:
      type: object
      properties:
        total:
          type: number
          example: 125
        perPage:
          type: number
          example: 50
        currentPage:
          type: number
          example: 1
        totalPages:
          type: number
          example: 3

````