> ## 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 journal

> Create a journal in the accounting system



## OpenAPI

````yaml post /consumers/{consumer_id}/accounting/journal
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/journal:
    post:
      tags:
        - Accounting
        - Journals
      summary: Create journal
      description: Create a journal in the accounting system
      operationId: accounting_create_journal
      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/JournalIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Journal'
        '400':
          content:
            application/json:
              example:
                message: >-
                  A journal already exists with the same code in the accounting
                  system.
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              example:
                message: >-
                  The counterpart account 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.journals
components:
  schemas:
    JournalIn:
      properties:
        code:
          type: string
          minLength: 2
          title: Code
          description: Short code or identifier of the journal (e.g., 'BNK', 'INV').
        name:
          type: string
          minLength: 1
          title: Name
          description: Name or label of the journal as it appears in the accounting system.
        journal_type:
          $ref: '#/components/schemas/JournalInType'
          description: 'Type of journal. '
        counterpart_account:
          anyOf:
            - type: string
            - type: 'null'
          title: Counterpart Account
          description: >-
            When journal is of type bank or cash, this is account number of the
            counterpart account used for the journal.
      type: object
      required:
        - code
        - name
        - journal_type
      title: JournalIn
    Journal:
      properties:
        id:
          type: string
          title: Id
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        name:
          type: string
          title: Name
        journal_type:
          $ref: '#/components/schemas/JournalType'
        counterpart_account:
          anyOf:
            - type: string
            - type: 'null'
          title: Counterpart Account
          description: >-
            When journal is of type bank or cash, this is account number of the
            counterpart account used for the journal.
        unallocated_account:
          anyOf:
            - type: string
            - type: 'null'
          title: Unallocated Account
          description: >-
            Unallocated ledger account used to book entries when the final
            ledger account / client / supplier / employee is not yet known
            (specific to bank and cash journals)
        next_document_numbers:
          anyOf:
            - items:
                $ref: '#/components/schemas/NextDocumentNumber'
              type: array
            - type: 'null'
          title: Next Document Numbers
          default: []
        iban:
          anyOf:
            - type: string
            - type: 'null'
          title: Iban
          description: >-
            When the journal is of type bank, IBAN of the bank account linked to
            the journal 
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: >-
            Currency of the journal (e.g., EUR). If empty, the journal follows
            the currency of the accounting folder.
        other_currencies_allowed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Other Currencies Allowed
          description: >-
            Indicates if the journal allows other currencies. If it doesn't
            allow other currencies an exchange rate must be provided for Chift
            to convert the amounts to the journal currency. This only applicable
            if the journal currency is the same as the accounting folder
            currency.
          default: true
        blocked:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Blocked
          description: Indicates if the journal is blocked for creating entries.
          default: false
      type: object
      required:
        - id
        - name
        - journal_type
      title: Journal
    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'
    JournalInType:
      type: string
      enum:
        - customer_invoice
        - customer_refund
        - supplier_invoice
        - supplier_refund
        - bank
        - cash
        - miscellaneous_operation
      title: JournalInType
    JournalType:
      type: string
      enum:
        - customer_invoice
        - customer_refund
        - supplier_invoice
        - supplier_refund
        - financial_operation
        - miscellaneous_operation
        - unknown
      title: JournalType
    NextDocumentNumber:
      properties:
        bookyear_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Bookyear Name
        next_document_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Document Number
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
      type: object
      title: NextDocumentNumber
    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
  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.

````