LexOffice icon

LexOffice

LexOffice API Operations

Overview

The Create Company - Customer operation in the LexOffice n8n node allows you to create a new company contact with a customer role in your LexOffice account. This is particularly useful for automating the onboarding of new business clients, syncing CRM data, or integrating LexOffice with other systems where company customer records need to be created programmatically.

Practical examples:

  • Automatically add new B2B customers from a web form into LexOffice as company contacts.
  • Sync company customer data from another CRM or ERP system into LexOffice.
  • Batch import company customers from a spreadsheet using n8n workflows.

Properties

Name Type Meaning
Company Name String (text) The name of the company to be created as a customer.
Contact Persons Fixed Collection Details about one contact person for the company, including salutation, first/last name, email, and phone number. Only one contact person can be added per execution.
Billing Addresses Fixed Collection Billing address details for the company, including street, zip, city, and country code (ISO 3166 alpha2). Only one billing address can be added per execution.
Additional Fields Collection Optional fields: mobile phone number, private phone number, and business email for the company.

Output

The output will be a JSON object representing the newly created company contact in LexOffice. The structure typically includes:

{
  "id": "string",              // Unique identifier for the contact
  "version": 0,
  "roles": {
    "customer": {}
  },
  "company": {
    "name": "string",
    "contactPersons": [
      {
        "salutation": "string",
        "firstName": "string",
        "lastName": "string",
        "emailAddress": "string",
        "phoneNumber": "string"
      }
    ]
  },
  "addresses": {
    "billing": [
      {
        "street": "string",
        "zip": "string",
        "city": "string",
        "countryCode": "string"
      }
    ]
  },
  "emailAddresses": {
    "business": ["string"]
  },
  "phoneNumbers": {
    "mobile": ["string"],
    "private": ["string"]
  }
}
  • The actual response may include additional metadata or fields depending on the LexOffice API.

Dependencies

  • External Service: Requires access to the LexOffice API.
  • API Key: You must configure valid LexOffice API credentials in n8n under the name lexOfficeApi.
  • n8n Configuration: No special environment variables are required beyond standard credential setup.

Troubleshooting

Common Issues:

  • Missing Required Fields: If "Company Name" or required contact person fields are missing, the API will reject the request.
  • Invalid Country Code: The billing address country code must be a valid ISO 3166 alpha2 code (e.g., "DE" for Germany).
  • Authentication Errors: Invalid or missing API credentials will result in authentication failures.
  • API Rate Limits: Excessive requests may trigger rate limiting by LexOffice.

Error Messages & Resolutions:

  • "400 Bad Request": Check that all required fields are filled and formatted correctly.
  • "401 Unauthorized": Ensure your LexOffice API credentials are set up and active in n8n.
  • "422 Unprocessable Entity": Review field values for correct formats (e.g., email addresses, country codes).

Links and References

Discussion