Daten welche Enneo an ihren Code übergibt (Input)
Kopieren
KI fragen
{
"customerId": "C-abcd-123"
}
Datenstruktur welche Enneo als Rückgabewert erwartet (Output)
Kopieren
KI fragen
{
// Mandatory properties. Must be defined or enneo to work
"id": "C-abcd-123", // must be integer or string up to 50 chars
"business": false, // boolean, if the customer is a company or private person
"lastname": "Smith", // last name of customer, can be null ONLY if business is true
"company": null, // company name, e.g. "ACME Corp.", can be null ONLY if business is false
"contractIds": ["VN-00001", "VN-00002"], // array of contracts this customer has. Must be at least one contract (otherwise it's not a "customer")
// Recommended properties. Should be defined if possible and is used by Enneo's AI and customer identification logic. Default to null if not set
"firstname": "John", // first name of customer, can be null
"email": "[email protected]",
"deliveryAddress": "Horst-Kohl-Str. 15a, 12157 Berlin", // address of customer
"billingAddress": null, // Optional separate billing address. If null, then billing address is the same as delivery address
"phone": "+49190332332",
// You may define any other properties you want enneo to be aware of here.
// See below some examples as inspiration from the energy sector
"salutation": "Mrs."
}
Beispielimplementierung
- PHP
Kopieren
KI fragen
<?php
// Load enneo SDK. Input is made available through $in
use EnneoSDK\ApiEnneo;
use EnneoSDK\Setting;
use EnneoSDK\Api;
require(getenv()['SDK']);
// Note: Customer data properties are largely the same as contract properties. In regular cases, they should be identical, but enneo gives you the option to have different data
// Example is a Holding on customer level, but subsidiaries with different legal entities on contract level
// Insert your API-Calls here, as described in the previous section
$customerRawData = Api::call(method: 'GET', url: 'https://admin.enneo.ai/api/seed-customers/' . $in->customerId);
$customer = [
// Mandatory properties. Must be defined or enneo to work
'id' => $in->customerId, // must be integer or string up to 50 chars
'business' => $customerRawData->processedData->business, // boolean, if the customer is a company or private person
'lastname' => $customerRawData->processedData->lastname, // last name of customer, can be null ONLY if business is true
'company' => $customerRawData->processedData->company, // company name, e.g. "ACME Corp.", can be null ONLY if business is false
'contractIds' => $customerRawData->processedData->contractIds, // array of contract this customer has. Must be at least one contract (otherwise it's not a "customer") e.g. ['VN-00001','VN-00002']
// Recommended properties. Should be defined if possible and is used by Enneo's AI and customer identification logic. Default to null if not set
'firstname' => $customerRawData->processedData->firstname, // first name of customer, can be null
'email' => $customerRawData->processedData->email,
'deliveryAddress' => $customerRawData->processedData->deliveryAddress, // address of customer
'billingAddress' => $customerRawData->processedData->billingAddress, // Optional separate billing address. If null, then billing address is the same as delivery address
'phone' => $customerRawData->processedData->phone,
];
// You may define any other properties you want enneo to be aware of here.
$customer = [
...$customer,
...array_diff_key((array) $customerRawData->processedData, $customer)
];
echo json_encode($customer);