> ## 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 expense async

## Field support per integration

> [accordion] DATEV Unternehmen Online
>
> > [!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`](https://docs.maesn.com/async-task) section.
>
> > [!NOTE]
> >
> > If you're not using the [Interactive Authentication Flow](https://docs.maesn.com/authentication.md#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.
>
> Supported request parameters:
>
> **expense** `string` *required*
>
> **properties**
>
> **account** `Account`
>
> **properties**
>
> **name** `string` *required*
>
> The `account.name` field represents the name of the correct ledger folder where the data will be sent to.\
> To get the correct name, you can use the  `GET Accounts` endpoint.\
> Note that the `ledgerName` must be of type `CASH`.
>
> **currency** `enum` *required*
>
> The `currency` field supports **ISO 4217** (3-letter codes).
> For details visits the [`Standardized Data`](https://docs.maesn.com/standardization) section.
>
> **generatorName** `string` *required*
>
> **expenseLines** `JournalLineItem[]` *required*
>
> **properties**
>
> **account** `Account`
>
> **properties**
>
> **number** `number`
>
> The `account.number` field specifies the general ledger account linked to the expense line.
>
> **description** `string` *required*
>
> The `description` field provides details about the specific expense line.
>
> It cannot exceed 60 characters in length.
>
> **dimensions** `Dimension`
>
> **properties**
>
> **name** `string`
>
> The `name` field specifies the name of the dimension associated with the expense line.
>
> It cannot exceed 36 characters in length. It must follow the pattern : `^([\S][\S ]{0,34}[\S]|[\S]{0,1})$`.
>
> Example: `Marketing`.
>
> **documentNumber** `string`
>
> The `documentNumber` field represents the document number reference.
>
> It must match the pattern: `^[a-zA-Z0-9$%&*\+\-/]{0,36}$`.
>
> \*\*taxRate \*\* `taxRate`
>
> **properties**
>
> **code** `string`
>
> \*\*taxRatePercentage \*\* `number`
>
> The `taxRatePercentage` field represents the tax rate applied to the expense line.
>
> It must be a positive number.
>
> **totalGrossAmount** `number` *required*
>
> \*\*note \*\* `string`
>
> The `note` field allows for additional information or comments related to the expense.
> It cannot exceed 120 characters in length.
>
> **totalGrossAmount** `number` *required*
>
> \*\*transactionDate \*\* `string` *required*
>
> **files** `file[]`


## OpenAPI

````yaml post /accounting/expenses/async
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/expenses/async:
    post:
      tags:
        - accounting
      operationId: createExpenseAsync
      parameters:
        - name: companyId
          required: false
          in: query
          schema:
            type: string
        - name: X-API-KEY
          description: API key
          in: header
          schema:
            type: string
          required: true
        - name: X-ACCOUNT-KEY
          description: Account key
          in: header
          schema:
            type: string
          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
                expense:
                  $ref: '#/components/schemas/ExpenseRequestAsyncDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponseDto'
                  - properties:
                      data:
                        $ref: '#/components/schemas/TaskIdResponseDto'
                        type: object
components:
  schemas:
    ExpenseRequestAsyncDto:
      type: object
      properties:
        'account ':
          $ref: '#/components/schemas/AccountCommonDto'
        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: 8a32de4f-55cc-4962-b000-a2a20662b821
        description:
          type: string
          example: Expense_07/25 for business trip
        documentId:
          type: string
          example: c77fbedb-1ff3-4fed-8716-4d3e3fc85ccf
        expenseLines:
          type: array
          items:
            $ref: '#/components/schemas/expenseLineItemAsyncRequest'
        generatorName:
          type: string
          example: Maesn GmbH
        journalCode:
          type: string
          example: '60'
        note:
          type: string
          example: Gasoline for business trip
        paymentTermId:
          type: string
          example: d2f3e4b5-6a7b-8c9d-0e1f-2g3h4i5j6k7l
        paymentType:
          type: string
          enum:
            - CASH
            - CHECK
            - CREDIT_CARD
            - CREDIT
            - COLLECTION
          example: CASH
        supplierId:
          type: string
          example: 52c049b9-91b7-4828-b346-e1eeadfa31dd
        type:
          type: string
          enum:
            - EXPENSE
            - REFUND
        totalGrossAmount:
          description: >-
            Gross total — the net amount plus tax (the total payable, including
            VAT).
          type: number
          example: 119
        totalNetAmount:
          description: Net total — the sum of all line amounts before tax (excluding VAT).
          type: number
          example: 100
        totalTaxAmount:
          description: Tax (VAT) total — the difference between the gross and net totals.
          type: number
          example: 5
        transactionDate:
          type: string
          example: '2025-07-15T00:00:00Z'
    BaseResponseDto:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MetaResponse'
        data:
          oneOf:
            - type: object
            - type: array
    TaskIdResponseDto:
      type: object
      properties:
        taskId:
          type: string
          example: 02cc5849-b23c-48fe-8a9b-96f74bfc9571
    AccountCommonDto:
      type: object
      properties:
        id:
          type: string
          example: db32-4f56-8a9b-1234567890ab
        code:
          type: string
          example: '200'
        name:
          type: string
          example: EXPENSE
        number:
          type: number
          example: 4900
    expenseLineItemAsyncRequest:
      type: object
      properties:
        'account ':
          $ref: '#/components/schemas/AccountCommonDto'
        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: Gasoline for business trip
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/dimension'
        documentNumber:
          type: string
          example: EXP-12345
        exchangeRate:
          type: number
          example: 1
        itemId:
          type: string
          example: 9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b
        taxRate:
          $ref: '#/components/schemas/taxRateV2'
          type: object
        totalGrossAmount:
          description: Gross amount of the line item — net plus tax (including VAT).
          type: number
          example: 119
        totalNetAmount:
          description: Net amount of the line item — before tax (excluding VAT).
          type: number
          example: 100
    MetaResponse:
      type: object
      properties:
        warnings:
          type: array
          items:
            type: string
            example: Field not used by target system
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
        partialErrors:
          type: array
          description: >-
            Secondary operations that failed after the main operation succeeded.
            See [Partial Errors](/guides/partial-errors).
          items:
            type: object
            properties:
              code:
                type: string
                example: FILE_UPLOAD_FAILED
              message:
                type: string
                example: >-
                  Attachment invoice.pdf could not be uploaded to the target
                  system.
    dimension:
      type: object
      properties:
        id:
          type: string
          example: efa82f42-fd85-11e1-a21f-0800200c9a33
        categoryName:
          type: string
          example: CostCenter
        name:
          type: string
          example: Material/Waren
    taxRateV2:
      type: object
      properties:
        id:
          type: string
          example: 1895b05b-38a6-4a6a-9653-166389894350
        code:
          type: string
          example: '03'
        description:
          type: string
          example: Tax19
        taxRatePercentage:
          type: number
          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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.