New order via form, all details are substracted and new customer in lexoffice

:us: I am trying to use Make to automatically create contacts from a Fluent Forms form (WordPress) as new contacts via a webhook in Lexoffice.

The connection to Fluent Forms works: The data arrives cleanly in the webhook (first name, last name, email, address, etc.).
The Lexoffice module is configured correctly: First name, last name and role (“Customer”) are transferred.

Problem:
I constantly get the following error with the emailAddresses field:

sql
Copy
Edit
Validation failed for 1 parameter(s): Array of objects expected in parameter ‘emailAddresses’
What I have tried so far:

Enabled mapping and entered the following JSON code in the emailAddresses field:

json
Copy
Edit
[
{
“email": ”1st email”
}
]
Also tried with Mustache syntax ({{1.email}}) and with ifempty() fallback.

Converted the value with JSON.stringify() as a test.

Variable checked in the webhook: The e-mail exists and is transferred correctly.

All mandatory fields in Lexoffice filled in correctly.

Always the same error: Array of objects expected.

How exactly must the emailAddresses field be mapped so that Lexoffice accepts it? Is there a special feature of JSON mapping in Make for arrays in this module?


Ich versuche, mit Make automatisch Kontakte aus einem Fluent Forms Formular (WordPress) Ăźber einen Webhook in Lexoffice als neue Kontakte anzulegen.

Die Verbindung zu Fluent Forms klappt: Die Daten kommen sauber im Webhook an (Vorname, Nachname, E-Mail, Adresse etc.).
Das Lexoffice-Modul ist korrekt konfiguriert: Vorname, Nachname und Rolle („Customer“) werden übernommen.

Problem:
Beim Feld emailAddresses bekomme ich konstant folgenden Fehler:

sql
Kopieren
Bearbeiten
Validation failed for 1 parameter(s): Array of objects expected in parameter ‘emailAddresses’
Was ich bisher probiert habe:

Mapping aktiviert und folgenden JSON-Code im Feld emailAddresses eingegeben:

json
Kopieren
Bearbeiten
[
{
“email”: “1. E-Mail”
}
]
Auch versucht mit Mustache-Syntax ({{1.E-Mail}}) und mit ifempty()-Fallback.

Testweise den Wert mit JSON.stringify() umgewandelt.

Variable im Webhook geprĂźft: Die E-Mail ist vorhanden und korrekt Ăźbergeben.

Alle Pflichtfelder in Lexoffice korrekt ausgefĂźllt.

Immer wieder der gleiche Fehler: Array of objects expected.

Wie muss das Feld emailAddresses genau gemappt werden, damit Lexoffice es akzeptiert? Gibt es eine Besonderheit beim JSON-Mapping in Make fĂźr Arrays in diesem Modul?

HI @Friederike_Schulz ,

According to their API docs, it should look something like this:

So I’m expecting it will work if you submit it like this:

[{"emailAddresses": {
        "business": [
            "business@lexoffice.de"
        ],
        "office": [
            "office@lexoffice.de"
        ],
        "private": [
            "private@lexoffice.de"
        ],
        "other": [
            "other@lexoffice.de"
        ]
}
}]

(delete the email types you don’t need).

Hope that sends you in the right direction!

Thomas
Nola Digital