Purpose: Read a customer by their known orderManager customer number and check the mapping to the ERP.
Prerequisites: orderManager with the Connect interface, OrderManagerClient configured, and the customer number from orderManager.
Code
var customer = await client.GetCustomer("462642");
if (customer is null)
{
Console.WriteLine("Kunde nicht gefunden.");
}
else
{
Console.WriteLine($"{customer.CustomerNumber}: {customer.CustomerNumberExternal}");
}
GET https://connect.homag.cloud/api/orderManager/customers?customerNumber=462642
Authorization: Basic <base64(SubscriptionId:Berechtigungsschlüssel)>
Accept: application/json
200 OK (excerpt):
[
{
"customerNumber": "462642",
"customerNumberExternal": "ERP-C-10045",
"customerName": "Musterkunde"
}
]
REST returns a list. The SDK call returns the first match as a single object. Use customerNumber to filter; customerNumberExternal is the number from your ERP and is not a filter for this endpoint.
Contracts used
| Contract | Usage |
|---|---|
Customer |
Output: customer data with the internal and, if available, external customer number. |
Common errors
| Result | What to check |
|---|---|
No match ([] in REST, null in the SDK call) |
Check that you are using the orderManager customer number for the correct subscription. |
