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

> Create a new employee expense



## OpenAPI

````yaml post /consumers/{consumer_id}/accounting/expenses
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/expenses:
    post:
      tags:
        - Accounting
        - Expenses
      summary: Create an expense
      description: Create a new employee expense
      operationId: accounting_create_expense
      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/ExpenseItemIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseItemOut'
        '400':
          content:
            application/json:
              example:
                message: Error while trying to perform your request
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - mcp_auth:
            - accounting
            - accounting.expenses
components:
  schemas:
    ExpenseItemIn:
      properties:
        employee_id:
          type: string
          title: Employee Id
          description: Employee identifier in the accounting system.
        total:
          type: number
          title: Total
          description: Total amount including taxes for the expense.
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Total untaxed amount for the expense.
        tax_amount:
          type: number
          title: Tax Amount
          description: Total tax amount for the expense.
        reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference
          description: External reference.
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
          description: Unique number for idempotency in the accounting system.
        currency:
          type: string
          title: Currency
          description: Currency of the expense (e.g., EUR, USD).
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: >-
            Exchange rate at expense date if currency differs from folder
            currency. Must be positive if provided.
          default: 1
        date:
          type: string
          format: date
          title: Date
          description: Expense date.
        pdf:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdf
          description: Base64 PDF attachment of the expense document.
        pdf_name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
              pattern: ^[a-zA-Z0-9\-_ ]{1,196}(?:.pdf)?$
            - type: 'null'
          title: Pdf Name
          description: >-
            A name for the PDF file to be created for accounting software that
            support it.
        lines:
          items:
            $ref: '#/components/schemas/ExpenseLineItem'
          type: array
          minItems: 1
          title: Lines
          description: Expense lines.
      type: object
      required:
        - employee_id
        - total
        - untaxed_amount
        - tax_amount
        - currency
        - date
        - lines
      title: ExpenseItemIn
    ExpenseItemOut:
      properties:
        employee_id:
          type: string
          title: Employee Id
          description: Employee identifier in the accounting system.
        total:
          type: number
          title: Total
          description: Total amount including taxes for the expense.
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Total untaxed amount for the expense.
        tax_amount:
          type: number
          title: Tax Amount
          description: Total tax amount for the expense.
        reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference
          description: External reference.
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
          description: Unique number for idempotency in the accounting system.
        currency:
          type: string
          title: Currency
          description: Currency of the expense (e.g., EUR, USD).
        currency_exchange_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Currency Exchange Rate
          description: >-
            Exchange rate at expense date if currency differs from folder
            currency. Must be positive if provided.
          default: 1
        date:
          type: string
          format: date
          title: Date
          description: Expense date.
        pdf:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdf
          description: Base64 PDF attachment of the expense document.
        pdf_name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
              pattern: ^[a-zA-Z0-9\-_ ]{1,196}(?:.pdf)?$
            - type: 'null'
          title: Pdf Name
          description: >-
            A name for the PDF file to be created for accounting software that
            support it.
        lines:
          items:
            $ref: '#/components/schemas/ExpenseLineItem'
          type: array
          minItems: 1
          title: Lines
          description: Expense lines.
        id:
          type: string
          title: Id
          description: Unique id of the expense in the accounting system.
      type: object
      required:
        - employee_id
        - total
        - untaxed_amount
        - tax_amount
        - currency
        - date
        - lines
        - id
      title: ExpenseItemOut
    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'
    ExpenseLineItem:
      properties:
        total:
          type: number
          title: Total
          description: Total amount for the line including taxes.
        untaxed_amount:
          type: number
          title: Untaxed Amount
          description: Untaxed amount for the line.
        tax_amount:
          type: number
          title: Tax Amount
          description: Tax amount for the line.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Line description
        account_number:
          type: string
          title: Account Number
          description: General ledger account number to book the expense.
        tax_rate:
          type: number
          title: Tax Rate
          description: Tax rate (e.g., 21.0 for 21%).
        tax_id:
          type: string
          title: Tax Id
          description: Tax identifier to validate against the provided tax_rate.
      type: object
      required:
        - total
        - untaxed_amount
        - tax_amount
        - account_number
        - tax_rate
        - tax_id
      title: ExpenseLineItem
    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.

````