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

# Create bookings

## Field support per integration

<AccordionGroup>
  <Accordion title="Datev Rechnungswesen" icon="https://mintcdn.com/maesn/NQwZPkomn6wLid0x/logo/datev.svg?fit=max&auto=format&n=NQwZPkomn6wLid0x&q=85&s=5589154dcfa064e1d967a067e488896a" width="24" height="24" data-path="logo/datev.svg">
    <Note>
      This endpoints is asynchronous. To check the status of the request, use the `GET asyncTask` endpoint.

      For more info about asynchronous tasks visit the [`Asynchronous Task`](/async-task) section.
    </Note>

    <Note>
      If you're not using the [Interactive Authentication Flow](/authentication#interactive-authentication-flow), make sure the query parameter `companyId` is accurately populated with the appropriate company ID. You can obtain this value by using the `GET Companies` endpoint available under the Authentication section.
    </Note>

    Supported Request Parameters:

    <ResponseField name="accountNumberLength" type="number" required>
      The `accountNumberLength` field specifies the length of the G/L accounts.
      The value must match the configuration defined in the end user’s mandate settings within the DATEV application.
    </ResponseField>

    <ResponseField name="chartOfAccount" type="string" required>
      Available options: `SKR03`, `SKR04`, `SKR42`, `SKR51`, `SKR14`
    </ResponseField>

    <ResponseField name="entries" type="BookingEntryRequestDto">
      <Expandable title="properties">
        <ResponseField name="accountNumber" type="number" required>
          This is typically the customer or supplier account number.
        </ResponseField>

        <ResponseField name="amount" type="number" required />

        <ResponseField name="bookingDate" type="string" required>
          ISO-8601 date format, e.g., 2024-01-01T00:00:00Z
        </ResponseField>

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

        <ResponseField name="bookingType" type="enum">
          Available options: `PARTIAL_INVOICE`, `ADVANCED_PAYMENT_RECEIVED`, `FINAL_INVOICE`, `OTHER`
        </ResponseField>

        <ResponseField name="contraAccountNumber" type="number" required>
          This is the opposing account number used for the booking entry.

          It might be a bank, revenue, or expense account, depending on the nature of the transaction.
        </ResponseField>

        <ResponseField name="currency" type="enum">
          Available options (3-letter ISO 4217):
          `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`
        </ResponseField>

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

          `DEBIT` indicates a debit on the accountNumber and a credit on the contraAccountNumber.

          `CREDIT` indicates a credit on the accountNumber and a debit on the contraAccountNumber.
        </ResponseField>

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

        <ResponseField name="dimension1" type="string">
          The `dimension1` field represents the information for cost accounting (KOST1)
        </ResponseField>

        <ResponseField name="dimension2" type="string">
          The `dimension2` field represents the information for cost accounting (KOST2)
        </ResponseField>

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

        <ResponseField name="dueDate" type="string">
          ISO-8601 date format, e.g., 2024-01-01T00:00:00Z
        </ResponseField>

        <ResponseField name="fileId" type="string">
          The `fileId` field is used to attach a file to the booking entry.
          This is the ID of the file that you previously uploaded using the `POST Files` endpoint.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="fiscalYearStartDate" type="string" required>
      YYYY-MM-DD date format, e.g., 2025-01-01

      The `fiscalYearStartDate` field should be set to the first day of the fiscal year, which is usually January 1st.
      If the end user's fiscal year begins on a different date, please adjust this field accordingly.
    </ResponseField>

    <Note>
      If the provided date does not match the actual fiscal year start date, DATEV will not return an error code. However, the booking entries will not be posted in Rechnungswesen.
    </Note>
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml POST /accounting/bookings
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/bookings:
    post:
      tags:
        - accounting
      operationId: create Bookings
      parameters:
        - name: companyId
          required: false
          in: query
          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:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingsRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponseDto'
                  - properties:
                      data:
                        $ref: '#/components/schemas/BookingsResponseDto'
components:
  schemas:
    BookingsRequestDto:
      type: object
      properties:
        accounNumbertLength:
          type: number
          example: '4'
        chartOfAccount:
          type: string
          enum:
            - SKR03
            - SKR04
            - SKR42
            - SKR51
            - SKR14
          example: SKR03
        entries:
          type: array
          items:
            $ref: '#/components/schemas/BookingEntriesRequestDto'
        fiscalYearStartDate:
          type: string
          example: '2025-01-01'
    BaseResponseDto:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MetaResponse'
        data:
          oneOf:
            - type: object
            - type: array
    BookingsResponseDto:
      type: object
      properties:
        id:
          type: string
          example: '433445'
        accountNumberLength:
          type: number
          example: '4'
        chartOfAccount:
          type: string
          enum:
            - SKR03
            - SKR04
            - SKR42
            - SKR51
            - SKR14
          example: SKR03
        createdDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        entries:
          type: array
          items:
            $ref: '#/components/schemas/BookingEntriesResponseDto'
        fiscalYearStartDate:
          type: string
          example: '2025-01-01'
        taskId:
          type: string
          example: ABBDU8834993NND
    BookingEntriesRequestDto:
      type: object
      properties:
        accountNumber:
          type: number
          example: '70000'
        amount:
          type: number
          example: '1500'
        bookingDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        bookingTaxCode:
          type: string
          example: '9'
        bookingType:
          type: string
          enum:
            - PARTIAL_INVOICE
            - ADVANCED_PAYMENT_RECEIVED
            - FINAL_INVOICE
            - OTHER
          example: PARTIAL_INVOICE
        contraAccountNumber:
          type: number
          example: '4900'
        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
        debitCreditIndicator:
          type: string
          enum:
            - CREDIT
            - DEBIT
        description:
          type: string
          example: payment
        dimension1:
          type: string
          example: Marketing
        dimension2:
          type: string
          example: Service and Maintenance
        documentNumber:
          type: string
          example: Rg32029/2024
        dueDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        fileId:
          type: string
          example: AA7N4ICJ0SJIU38
    MetaResponse:
      type: object
      properties:
        warnings:
          type: array
          items:
            type: string
            example: Field not used by target system
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
    BookingEntriesResponseDto:
      type: object
      properties:
        accountNumber:
          type: number
          example: '70000'
        amount:
          type: number
          example: '1500'
        bookingDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        bookingTaxCode:
          type: string
          example: '9'
        bookingType:
          type: string
          enum:
            - PARTIAL_INVOICE
            - ADVANCED_PAYMENT_RECEIVED
            - FINAL_INVOICE
            - OTHER
          example: PARTIAL_INVOICE
        contraAccountNumber:
          type: number
          example: '4900'
        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
        debitCreditIndicator:
          type: string
          enum:
            - CREDIT
            - DEBIT
        description:
          type: string
          example: payment
        dimension1:
          type: string
          example: Marketing
        dimension2:
          type: string
          example: Service and Maintenance
        documentNumber:
          type: string
          example: Rg32029/2024
        dueDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        fileId:
          type: string
          example: AA7N4ICJ0SJIU38
    PaginationResponse:
      type: object
      properties:
        total:
          type: number
          example: 125
        perPage:
          type: number
          example: 50
        currentPage:
          type: number
          example: 1
        totalPages:
          type: number
          example: 3

````