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

<AccordionGroup>
  <Accordion title="DATEV Unternehmen Online" 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="expense" type="string" required>
      <Expandable title="properties">
        <ResponseField name="account" type="Account">
          <Expandable title="properties">
            <ResponseField name="name" type="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`.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="currency" type="enum" required>
          The `currency` field supports **ISO 4217** (3-letter codes).
          For details visits the [`Standardized Data`](/standardization) section.
        </ResponseField>

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

        <ResponseField name="expenseLines" type="JournalLineItem[]" required>
          <Expandable title="properties">
            <ResponseField name="account" type="Account">
              <Expandable title="properties">
                <ResponseField name="number" type="number">
                  The `account.number` field specifies the general ledger account linked to the expense line.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="description" type="string" required>
              The `description` field provides details about the specific expense line.

              It cannot exceed 60 characters in length.
            </ResponseField>

            <ResponseField name="dimensions" type="Dimension">
              <Expandable title="properties">
                <ResponseField name="name" type="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`.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="documentNumber" type="string">
              The `documentNumber` field represents the document number reference.

              It must match the pattern: `^[a-zA-Z0-9$%&*\+\-/]{0,36}$`.
            </ResponseField>

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

                <ResponseField name="taxRatePercentage " type="number">
                  The `taxRatePercentage` field represents the tax rate applied to the expense line.

                  It must be a positive number.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="totalGrossAmount" type="number" required />
          </Expandable>
        </ResponseField>

        <ResponseField name="note " type="string">
          The `note` field allows for additional information or comments related to the expense.
          It cannot exceed 120 characters in length.
        </ResponseField>

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

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

    <ResponseField name="files" type="file[]" />
  </Accordion>
</AccordionGroup>


## 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:
          type: number
          example: 119
        totalNetAmount:
          type: number
          example: 100
        totalTaxAmount:
          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:
          type: number
          example: 119
        totalNetAmount:
          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'
    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

````