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

# Create a journal entry



## OpenAPI

````yaml /openapi_v4_core.json post /v4/core/companies/{companyId}/journal_entries
openapi: 3.0.0
info:
  title: Commenda Integrations V4 API
  description: Commenda Integrations — unified accounting, commerce, and CRM API.
  version: 4.0.0
  contact: {}
servers:
  - url: https://api.integrations.commenda.io
    description: Production
security:
  - api_key: []
tags: []
paths:
  /v4/core/companies/{companyId}/journal_entries:
    post:
      tags:
        - Accounting
      summary: Create a journal entry
      operationId: create_journal_entries
      parameters:
        - name: companyId
          in: path
          required: true
          description: Commenda company id.
          schema:
            type: integer
        - name: run_async
          in: query
          required: false
          description: >-
            Process the write asynchronously. Required when `data` is an array
            (batch write).
          schema:
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  oneOf:
                    - $ref: '#/components/schemas/JournalEntryWrite'
                    - type: array
                      items:
                        $ref: '#/components/schemas/JournalEntryWrite'
              required:
                - data
      responses:
        '201':
          description: The created journal_entries record (sync) or a sync id (async).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/JournalEntry'
                        nullable: true
                        description: >-
                          The written record, read back (synchronous writes
                          only).
                      sync_id:
                        type: string
                    required:
                      - sync_id
                  request_id:
                    type: string
                required:
                  - data
                  - request_id
components:
  schemas:
    JournalEntryWrite:
      type: object
      properties:
        platform_id:
          type: string
          example: string
        account_id:
          type: string
          nullable: true
          example: string
        amount:
          type: number
          nullable: true
          example: 0
        currency_id:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOV
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BZD
            - CAD
            - CDF
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - 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
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRU
            - MUR
            - MVR
            - MWK
            - MXN
            - MXV
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLE
            - SOS
            - SRD
            - SSP
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - USN
            - UYI
            - UYU
            - UYW
            - UZS
            - VED
            - VES
            - VND
            - VUV
            - WST
            - XAF
            - XAG
            - XAU
            - XBA
            - XBB
            - XBC
            - XBD
            - XCD
            - XDR
            - XOF
            - XPD
            - XPF
            - XPT
            - XSU
            - XTS
            - XUA
            - XXX
            - YER
            - ZAR
            - ZMW
            - ZWG
          nullable: true
          example: AED
        currency_rate:
          type: number
          nullable: true
          example: 0
        journal_entry_type:
          type: string
          nullable: true
          example: string
        description:
          type: string
          nullable: true
          example: string
        posted_date:
          type: string
          format: date-time
          nullable: true
          example: '2024-01-01T00:00:00Z'
        document_number:
          type: string
          nullable: true
          example: string
        business_unit_id:
          type: string
          nullable: true
          example: string
        updated_at:
          type: string
          format: date-time
          nullable: true
          example: '2024-01-01T00:00:00Z'
        journal_lines:
          type: array
          items:
            $ref: '#/components/schemas/JournalLineWrite'
          nullable: true
      required:
        - platform_id
    JournalEntry:
      type: object
      properties:
        rootfi_id:
          type: integer
          description: Unique identifier assigned by Commenda for this journal entry
        rootfi_created_at:
          type: string
          format: date-time
          description: >-
            Timestamp when this record was created in Commenda's system (ISO
            8601)
        rootfi_updated_at:
          type: string
          format: date-time
          description: >-
            Timestamp when this record was last updated in Commenda's system
            (ISO 8601)
        rootfi_integration_type:
          type: string
          enum:
            - BUSY
            - CLEARBOOKS
            - FREEAGENT
            - FRESHBOOKS
            - KASHFLOW
            - MEKARI_JURNAL
            - MS_DYNAMICS_365
            - MS_DYNAMICS_365_FO
            - MYOB_BUSINESS
            - NETSUITE
            - ODOO_ACCOUNTING
            - QOYOD
            - QUICKBOOKS
            - QUICKBOOKS_SANDBOX
            - ROOTFI_SANDBOX
            - SAGE_CLOUD_ACCOUNTING
            - SAGE_ZA_CLOUD_ACCOUNTING
            - SAGE_INTACCT
            - TALLY
            - WAFEQ
            - WAVE
            - XERO
            - ZOHO_BOOKS
            - PUZZLE_SANDBOX
            - PUZZLE
            - RILLET
            - RILLET_SANDBOX
            - AMAZON
            - BIG_COMMERCE
            - SHOPIFY
            - SQUARESPACE
            - WIX
            - WOO_COMMERCE
            - GOOGLE_PLAYSTORE
            - CHARGEBEE
            - MOLLIE
            - PAYPAL
            - PAYPAL_SANDBOX
            - RAZORPAY
            - SQUARE
            - SQUARE_SANDBOX
            - STRIPE
            - STRIPE_TEST
            - STRIPE_SANDBOX
            - ZOHO_INVOICE
            - PADDLE
            - PADDLE_SANDBOX
            - HUBSPOT
            - PIPEDRIVE
            - SALES_FORCE
            - ZOHO_CRM
            - GUSTO
        platform_id:
          type: string
          description: >-
            Unique identifier for this journal entry in the source accounting
            platform
        account_id:
          type: string
          nullable: true
          description: The account ID of the journal entry
        amount:
          type: number
          nullable: true
          description: The total amount of the journal entry
        currency_id:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOV
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BZD
            - CAD
            - CDF
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - 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
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRU
            - MUR
            - MVR
            - MWK
            - MXN
            - MXV
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLE
            - SOS
            - SRD
            - SSP
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - USN
            - UYI
            - UYU
            - UYW
            - UZS
            - VED
            - VES
            - VND
            - VUV
            - WST
            - XAF
            - XAG
            - XAU
            - XBA
            - XBB
            - XBC
            - XBD
            - XCD
            - XDR
            - XOF
            - XPD
            - XPF
            - XPT
            - XSU
            - XTS
            - XUA
            - XXX
            - YER
            - ZAR
            - ZMW
            - ZWG
          nullable: true
          description: ISO 4217 currency code
        currency_rate:
          type: number
          nullable: true
          description: The currency rate of the journal entry
        journal_entry_type:
          type: string
          nullable: true
          description: The type of the journal entry
        description:
          type: string
          nullable: true
          description: The description of the journal entry
        posted_date:
          type: string
          format: date-time
          nullable: true
          description: The posted date of the journal entry
        document_number:
          type: string
          nullable: true
          description: The document number of the journal entry
        business_unit_id:
          type: string
          nullable: true
          description: The business unit ID of the journal entry
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: The date and time the journal entry was last updated
        journal_lines:
          type: array
          items:
            $ref: '#/components/schemas/JournalLine'
          nullable: true
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
          nullable: true
      required:
        - rootfi_id
        - rootfi_created_at
        - rootfi_updated_at
        - rootfi_integration_type
        - platform_id
      description: >-
        A Journal is a running record of a company's financial transactions used
        to record the debits and credits of each transaction.
    JournalLineWrite:
      type: object
      properties:
        platform_id:
          type: string
          example: string
        parent_id:
          type: string
          nullable: true
          example: string
        parent_type:
          type: string
          enum:
            - ACCOUNT
            - BALANCE_SHEET
            - BANK_ACCOUNT
            - BANK_TRANSACTION
            - BILL
            - BILL_CREDIT_NOTE
            - BILL_PAYMENT
            - CASH_FLOW_STATEMENT
            - COMPANY_INFO
            - CONTACT
            - CURRENCY
            - DOCUMENT
            - EXPENSE
            - GOODS_RECEIPT_NOTE
            - INCOME_STATEMENT
            - INVOICE
            - INVOICE_CREDIT_NOTE
            - INVOICE_PAYMENT
            - ITEM
            - JOURNAL_ENTRY
            - JOURNAL_LINE
            - PROJECT
            - PURCHASE_ORDER
            - SALES_ORDER
            - ESTIMATE
            - TAX_RATE
            - TRACKING_CATEGORY
            - CASH_SALE
            - CASH_REFUND
            - BALANCE
            - DISPUTE
            - ORDER
            - PAYOUT
            - SUBSCRIPTION
            - TRANSACTION
            - EVENT
            - FULFILLMENT
            - INVENTORY
            - COMPANY
            - LEAD
            - OPPORTUNITY
            - PIPELINE
            - PIPELINE_STAGE
            - NOTE
            - TASK
            - OWNER
            - ENGAGEMENT
            - ADDRESS
            - EXTERNAL_LINK
            - LINE_ITEM
            - PHONE_NUMBER
            - VARIANT
          nullable: true
          example: ACCOUNT
        account_id:
          type: string
          nullable: true
          example: string
        contact_id:
          type: string
          nullable: true
          example: string
        tax_id:
          type: string
          nullable: true
          example: string
        type:
          type: string
          enum:
            - CREDIT
            - DEBIT
          nullable: true
          example: CREDIT
        description:
          type: string
          nullable: true
          example: string
        net_amount:
          type: number
          nullable: true
          example: 0
        tax_amount:
          type: number
          nullable: true
          example: 0
        tracking_category_ids:
          type: array
          items:
            type: string
          example:
            - string
        updated_at:
          type: string
          format: date-time
          nullable: true
          example: '2024-01-01T00:00:00Z'
      required:
        - platform_id
        - tracking_category_ids
    JournalLine:
      type: object
      properties:
        rootfi_id:
          type: integer
        rootfi_created_at:
          type: string
          format: date-time
        rootfi_updated_at:
          type: string
          format: date-time
        rootfi_integration_type:
          type: string
          enum:
            - BUSY
            - CLEARBOOKS
            - FREEAGENT
            - FRESHBOOKS
            - KASHFLOW
            - MEKARI_JURNAL
            - MS_DYNAMICS_365
            - MS_DYNAMICS_365_FO
            - MYOB_BUSINESS
            - NETSUITE
            - ODOO_ACCOUNTING
            - QOYOD
            - QUICKBOOKS
            - QUICKBOOKS_SANDBOX
            - ROOTFI_SANDBOX
            - SAGE_CLOUD_ACCOUNTING
            - SAGE_ZA_CLOUD_ACCOUNTING
            - SAGE_INTACCT
            - TALLY
            - WAFEQ
            - WAVE
            - XERO
            - ZOHO_BOOKS
            - PUZZLE_SANDBOX
            - PUZZLE
            - RILLET
            - RILLET_SANDBOX
            - AMAZON
            - BIG_COMMERCE
            - SHOPIFY
            - SQUARESPACE
            - WIX
            - WOO_COMMERCE
            - GOOGLE_PLAYSTORE
            - CHARGEBEE
            - MOLLIE
            - PAYPAL
            - PAYPAL_SANDBOX
            - RAZORPAY
            - SQUARE
            - SQUARE_SANDBOX
            - STRIPE
            - STRIPE_TEST
            - STRIPE_SANDBOX
            - ZOHO_INVOICE
            - PADDLE
            - PADDLE_SANDBOX
            - HUBSPOT
            - PIPEDRIVE
            - SALES_FORCE
            - ZOHO_CRM
            - GUSTO
        platform_id:
          type: string
        parent_id:
          type: string
          nullable: true
        parent_type:
          type: string
          enum:
            - ACCOUNT
            - BALANCE_SHEET
            - BANK_ACCOUNT
            - BANK_TRANSACTION
            - BILL
            - BILL_CREDIT_NOTE
            - BILL_PAYMENT
            - CASH_FLOW_STATEMENT
            - COMPANY_INFO
            - CONTACT
            - CURRENCY
            - DOCUMENT
            - EXPENSE
            - GOODS_RECEIPT_NOTE
            - INCOME_STATEMENT
            - INVOICE
            - INVOICE_CREDIT_NOTE
            - INVOICE_PAYMENT
            - ITEM
            - JOURNAL_ENTRY
            - JOURNAL_LINE
            - PROJECT
            - PURCHASE_ORDER
            - SALES_ORDER
            - ESTIMATE
            - TAX_RATE
            - TRACKING_CATEGORY
            - CASH_SALE
            - CASH_REFUND
            - BALANCE
            - DISPUTE
            - ORDER
            - PAYOUT
            - SUBSCRIPTION
            - TRANSACTION
            - EVENT
            - FULFILLMENT
            - INVENTORY
            - COMPANY
            - LEAD
            - OPPORTUNITY
            - PIPELINE
            - PIPELINE_STAGE
            - NOTE
            - TASK
            - OWNER
            - ENGAGEMENT
            - ADDRESS
            - EXTERNAL_LINK
            - LINE_ITEM
            - PHONE_NUMBER
            - VARIANT
          nullable: true
        account_id:
          type: string
          nullable: true
        contact_id:
          type: string
          nullable: true
        tax_id:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - CREDIT
            - DEBIT
          nullable: true
        description:
          type: string
          nullable: true
        net_amount:
          type: number
          nullable: true
        tax_amount:
          type: number
          nullable: true
        tracking_category_ids:
          type: array
          items:
            type: string
        updated_at:
          type: string
          format: date-time
          nullable: true
      required:
        - rootfi_id
        - rootfi_created_at
        - rootfi_updated_at
        - rootfi_integration_type
        - platform_id
        - tracking_category_ids
    Document:
      type: object
      properties:
        rootfi_id:
          type: integer
          description: Unique identifier assigned by Commenda for this document
        rootfi_created_at:
          type: string
          format: date-time
          description: >-
            Timestamp when this record was created in Commenda's system (ISO
            8601)
        rootfi_updated_at:
          type: string
          format: date-time
          description: >-
            Timestamp when this record was last updated in Commenda's system
            (ISO 8601)
        rootfi_integration_type:
          type: string
          enum:
            - BUSY
            - CLEARBOOKS
            - FREEAGENT
            - FRESHBOOKS
            - KASHFLOW
            - MEKARI_JURNAL
            - MS_DYNAMICS_365
            - MS_DYNAMICS_365_FO
            - MYOB_BUSINESS
            - NETSUITE
            - ODOO_ACCOUNTING
            - QOYOD
            - QUICKBOOKS
            - QUICKBOOKS_SANDBOX
            - ROOTFI_SANDBOX
            - SAGE_CLOUD_ACCOUNTING
            - SAGE_ZA_CLOUD_ACCOUNTING
            - SAGE_INTACCT
            - TALLY
            - WAFEQ
            - WAVE
            - XERO
            - ZOHO_BOOKS
            - PUZZLE_SANDBOX
            - PUZZLE
            - RILLET
            - RILLET_SANDBOX
            - AMAZON
            - BIG_COMMERCE
            - SHOPIFY
            - SQUARESPACE
            - WIX
            - WOO_COMMERCE
            - GOOGLE_PLAYSTORE
            - CHARGEBEE
            - MOLLIE
            - PAYPAL
            - PAYPAL_SANDBOX
            - RAZORPAY
            - SQUARE
            - SQUARE_SANDBOX
            - STRIPE
            - STRIPE_TEST
            - STRIPE_SANDBOX
            - ZOHO_INVOICE
            - PADDLE
            - PADDLE_SANDBOX
            - HUBSPOT
            - PIPEDRIVE
            - SALES_FORCE
            - ZOHO_CRM
            - GUSTO
        platform_id:
          type: string
          description: >-
            Unique identifier for this document in the source accounting
            platform
        file_name:
          type: string
          nullable: true
          description: The file name of the document
        file_type:
          type: string
          nullable: true
          description: The file type of the document (MIME Type)
        file_size:
          type: number
          nullable: true
          description: The file size of the document in bytes
        document_type_id:
          type: string
          nullable: true
          description: The document type ID of the document
        document_type:
          type: string
          enum:
            - BILL
            - INVOICE
            - EXPENSE
            - BILL_CREDIT_NOTE
            - INVOICE_CREDIT_NOTE
            - PURCHASE_ORDER
            - SALES_ORDER
            - JOURNAL_ENTRY
          nullable: true
          description: The document type of the document
        document_uploaded:
          type: boolean
          nullable: true
          description: Whether RootFi has uploaded the document to its servers
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: The date and time the document was last updated
      required:
        - rootfi_id
        - rootfi_created_at
        - rootfi_updated_at
        - rootfi_integration_type
        - platform_id
      description: >-
        The Documents Data Model simplifies the handling of document documents
        across various accounting platforms, providing a standardised approach
        to accessing and managing document-related information.
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api_key
      description: Your Commenda Integrations API key, sent in the `api_key` header.

````