Purpose: Combine two already imported parts into a production lot and use the lot ID for further planning.
Prerequisites: productionManager with the Connect interface, ProductionManagerClient configured, and real part IDs from the order details that have not yet been fully scheduled. Replace the sample IDs and dates before making the call.
Code
using HomagConnect.ProductionManager.Contracts.Lots;
var lot = await client.CreateLotRequest(new CreateLotRequest
{
Name = "LOT-4711",
StartDatePlanned = new DateTimeOffset(2027, 6, 14, 6, 0, 0, TimeSpan.Zero),
CompletionDatePlanned = new DateTimeOffset(2027, 6, 14, 14, 0, 0, TimeSpan.Zero),
PartIds = new[] { "10706261", "10706263" }
});
Console.WriteLine(lot.LotId);
POST https://connect.homag.cloud/api/productionManager/lots
Authorization: Basic <base64(SubscriptionId:Berechtigungsschlüssel)>
Accept: application/json
Content-Type: application/json
{
"name": "LOT-4711",
"startDatePlanned": "2027-06-14T06:00:00Z",
"completionDatePlanned": "2027-06-14T14:00:00Z",
"partIds": ["10706261", "10706263"]
}
200 OK:
{
"lotId": "f6fd8084-29d1-4bba-a4b2-3c9c8d2fd6b1"
}
Save the returned lotId. You can use it later to retrieve the lot details.
Contracts used
| Contract | Usage |
|---|---|
CreateLotRequest |
Input: name, dates, and part IDs. |
CreateLotResponse |
Output: ID of the created lot. |
Common errors
| REST status | What to check |
|---|---|
422 Unprocessable Entity |
partIds must contain part IDs, not order or line-item numbers. Also check whether the parts are already fully scheduled. |
401 Unauthorized |
Check the SubscriptionId, authorization key, and app access. |
Next: Create lots: selection and grouping · View and test endpoint
