> ## Documentation Index
> Fetch the complete documentation index at: https://docs.famulor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# lexoffice Integration

> Automatic invoice creation in lexoffice directly during customer conversations for seamless accounting automation

# lexoffice Integration Template

Integrate lexoffice invoicing into your Mid-call Actions and enable your AI assistant to automatically create invoices, convert quotes, and streamline accounting processes during customer conversations.

## Overview & Features

<CardGroup cols={2}>
  <Card title="Instant Invoice Creation" icon="file-invoice">
    * Automatic invoice generation during sales calls
    * Contact integration from lexoffice master data
    * Tax calculation according to German law
    * PDF generation and email dispatch
  </Card>

  <Card title="Accounting Automation" icon="calculator">
    * Integration with tax advisor workflows
    * GoBD-compliant document archiving
    * Automated VAT advance return preparation
    * Liquidity and reporting integration
  </Card>
</CardGroup>

## lexoffice API Setup

### Configuration in the Famulor Interface

<Tabs>
  <Tab title="Tool Details">
    | Field                      | Value                                                                                                                               |
    | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
    | **Name**\*                 | `lexoffice Rechnung erstellen`                                                                                                      |
    | **Description**            | "Automatically creates a new invoice in lexoffice based on conversation content"                                                    |
    | **Function Name**\*        | `create_lexoffice_invoice`                                                                                                          |
    | **Function Description**\* | "Creates a new invoice in lexoffice. Use this when a customer is ready to purchase or you want to convert a quote into an invoice." |
    | **HTTP Method**            | `POST`                                                                                                                              |
    | **Timeout (ms)**           | `5000`                                                                                                                              |
    | **Endpoint**\*             | `https://api.lexoffice.io/v1/invoices`                                                                                              |
  </Tab>

  <Tab title="Request Body Template">
    ```json theme={null}
    {
      "voucherDate": "{invoice_date}",
      "address": {
        "contactId": "{contact_id}"
      },
      "lineItems": [
        {
          "type": "custom",
          "name": "{item_name}",
          "quantity": "{quantity}",
          "unitName": "{unit}",
          "unitPrice": {
            "currency": "EUR",
            "netAmount": "{net_amount}",
            "taxRatePercentage": "{tax_rate}"
          }
        }
      ],
      "totalPrice": {
        "currency": "EUR"
      },
      "taxConditions": {
        "taxType": "{tax_type}"
      },
      "paymentConditions": {
        "paymentTermLabel": "30 Tage netto",
        "paymentTermDuration": 30
      }
    }
    ```
  </Tab>
</Tabs>

### Parameter Schema

```json theme={null}
{
  "type": "object",
  "properties": {
    "invoice_date": {
      "type": "string",
      "format": "date",
      "description": "Invoice date (YYYY-MM-DD)"
    },
    "contact_id": {
      "type": "string",
      "description": "lexoffice contact ID of the customer"
    },
    "item_name": {
      "type": "string",
      "description": "Description of the service/product",
      "examples": ["Consulting service", "Software license", "Project setup"]
    },
    "quantity": {
      "type": "number",
      "description": "Quantity/count",
      "minimum": 0.01
    },
    "unit": {
      "type": "string",
      "description": "Unit (e.g., 'pieces', 'hours', 'flat rate')",
      "default": "pieces"
    },
    "net_amount": {
      "type": "number",
      "description": "Net unit price in Euro",
      "minimum": 0.01
    },
    "tax_rate": {
      "type": "integer",
      "enum": [0, 7, 19],
      "description": "Value-added tax rate in percent",
      "default": 19
    },
    "tax_type": {
      "type": "string",
      "enum": ["net", "gross"],
      "description": "Tax type (net or gross price specification)",
      "default": "net"
    }
  },
  "required": ["invoice_date", "contact_id", "item_name", "quantity", "net_amount"]
}
```

### Practical Scenarios

<Steps>
  <Step title="Instant Invoice During Sales Call">
    ```yaml theme={null}
    Sales Context:
      Customer: "That fits perfectly! Can you issue an invoice for me right away?"
      
    AI: "Gladly! I am creating the invoice in lexoffice..."

    create_lexoffice_invoice:
      invoice_date: "2024-01-15"
      contact_id: "abc123-def456-ghi789"
      item_name: "CRM Integration Premium Package"
      quantity: 1
      net_amount: 4500.00
      tax_rate: 19
    ```
  </Step>
</Steps>

***

<Tip>
  Related pages: [Introduction](/en/automation-platform/introduction) and [Building Flows](/en/automation-platform/building-flows), and [Debugging Runs](/en/automation-platform/debugging-runs).
</Tip>

<Tip>
  Need a whole toolset instead of building HTTP actions one by one? Connect an external **MCP server** — tools are discovered automatically. See [MCP Servers](/en/platform/mcp-servers).
</Tip>
