LexOffice icon

LexOffice

LexOffice API Operations

Overview

The Create Company - Customer & Vendor operation in the LexOffice n8n node allows you to create a new company contact in LexOffice with both customer and vendor roles. This is useful for businesses that interact with other companies as both clients (customers) and suppliers (vendors). For example, if your business both buys from and sells to another company, this operation ensures their contact record reflects both relationships.

Practical scenarios:

  • Onboarding a new business partner who will be both a supplier and a client.
  • Automating CRM updates when a company’s relationship status changes.
  • Integrating LexOffice with other systems to synchronize company contacts with dual roles.

Properties

Name Type Meaning
Company Name String The name of the company to be created.
Contact Persons Fixed Collection List of contact persons associated with the company, including salutation, names, email, etc.
Billing Addresses Fixed Collection Billing address details for the company (street, zip, city, country code).
Additional Fields Collection Optional fields such as mobile phone number, private phone number, and business email.

Details for each property:

  • Company Name: The official name of the company.
  • Contact Persons: Add one or more individuals linked to the company, specifying their salutation, first/last name, email, and phone number.
  • Billing Addresses: Specify billing address information, including street, zip code, city, and country code (ISO 3166 alpha2 format, e.g., "DE" for Germany).
  • Additional Fields:
    • Mobile Phone Number: A mobile number for the company.
    • Private Phone Number: A private phone number for the company.
    • Business Email: The main business email address.

Output

The output will be the JSON response from the LexOffice API after creating the company contact. Typically, this includes:

{
  "id": "string", // Unique identifier for the created contact
  "version": 0,
  "roles": {
    "customer": {},
    "vendor": {}
  },
  "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"]
  }
}

Note: The actual structure may vary depending on the LexOffice API's response.

Dependencies

  • External Service: Requires access to the LexOffice API.
  • API Key: You must configure LexOffice API credentials in n8n (lexOfficeApi).
  • n8n Configuration: Ensure the LexOffice node is properly installed and credentials are set up in your n8n instance.

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 country code must follow ISO 3166 alpha2 format (e.g., "DE"). Using an invalid code will result in an error.
  • Authentication Errors: Incorrect or missing API credentials will cause authentication failures.
  • API Rate Limits: Excessive requests may trigger rate limiting by LexOffice.

Error messages and resolutions:

  • "400 Bad Request": Check that all required fields are filled and formatted correctly.
  • "401 Unauthorized": Verify that your LexOffice API credentials are correct and active.
  • "422 Unprocessable Entity": Review the data types and formats, especially for nested objects like addresses and contact persons.

Links and References

Discussion