--- title: "Use Case: Import Orders" slug: "datenaustausch-connect-api-uc-om-import" updated: 2026-12-02T08:12:49Z published: 2026-12-02T08:12:49Z canonical: "docs.homag.cloud/datenaustausch-connect-api-uc-om-import" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.homag.cloud/llms.txt > Use this file to discover all available pages before exploring further. # Use Case: Import Orders **For:** Customers · Partners · Integrators Orders originate in an ERP system, an order configurator, an online shop, or a sales portal. They need to reach orderManager without manual entry so they can be released and distributed to production. ## Challenge When orders are entered manually, order processing starts late, data is entered twice and may contain typos, and the source system does not know whether the order arrived. The transfer must be automatic, and the source system must know whether it succeeded. ## Solution The source system transfers each order to orderManager as soon as it is ready. All formats are sent to `POST /api/orderManager/orders/import`: | Format | Contents | Use when | | --- | --- | --- | | **OrderDetails** (JSON), *standard* | The order header, for example external order number, name, customer, and dates, plus the hierarchy of groups, positions, and prices in `items`. Files are referenced by URI. | Recommended for all integrations. | | **OrderDetails with files** (`multipart/form-data`), *standard* | Order data and files are sent together in one request: the order JSON in a part named `order` and each file, such as an image, in a separate part. The name of each file part matches the file name referenced in the order's `additionalData`. | Files such as images cannot be accessed through a URI. | | **Project archive** (ZIP, `application/octet-stream`), *alternative* | A `project.xml` file in the root folder and the files it references. | Your system already creates a `project.xml` that follows the [HOMAG Import Specification](https://github.com/HomagGroup/HOMAG-Connect/blob/main/DataExchange/ImportSpecification.md). This is supported but is not the standard method. | orderManager sets the order status itself. It cannot be set externally. After a successful import, the order can be reviewed and released. > **Note:** orderManager assigns the `orderNumber` itself. You cannot set it externally. Pass the order number from your system as `orderNumberExternal`. If an import contains an `orderNumber`, orderManager stores it as `orderNumberExternal`. Reference the customer using the `customerNumber` assigned to them by orderManager. ## Workflow 1. Make sure the customer exists in orderManager and that you know their `customerNumber`. See [Use Case: Manage Customers](/docs/en/datenaustausch-connect-api-uc-om-kunden). 2. Import the order. The response contains a `correlationId`. 3. Check the import status until it is `Succeeded` or `Error`. On success, store the `orderId` in the source system. 4. Read and review the created order using the `orderId`. It contains the `orderNumber` assigned by orderManager. 5. Release the order. orderManager then distributes it to the target systems. > **Note:** Currently, an import automatically creates a missing customer. This behavior will be removed in a future version. Create customers explicitly before importing their orders. **C#** ```csharp var orderManager = new OrderManagerClient(subscriptionId, authorizationKey); // 2. Import the order var order = new OrderDetails {    ExternalSystemId = "ERP-2026-001284",    OrderNumberExternal = "ERP-2026-001284",    OrderName = "Bedroom & bathroom 01",    CustomerNumber = "462642", // assigned by orderManager    Source = "OrderConfigurator",    OrderDate = DateTime.Today,    DeliveryDatePlanned = DateTime.Today.AddDays(14),    Items =    [        new Group        {            Name = "Bedroom & bathroom 01",            Items =            [                new Position                {                    Name = "P 01.01",                    ArticleNumber = "67839",                    Quantity = 4,                    Description = "Cabinet left",                    Width = 100, Height = 150, Depth = 250,                    Items = [ new Price { UnitPrice = 100, TotalPrice = 400, Currency = "EUR" } ]                }            ]        }    ] }; var response = await orderManager.ImportOrderRequest(order); // 3. Wait for the import to complete and store the order ID var importedOrder = await orderManager.WaitForImportOrderCompletion(response.CorrelationId, TimeSpan.FromMinutes(1)); sourceSystem.StoreOrderManagerOrderId(importedOrder.Id); // 4. Read the created order var orderDetails = await orderManager.GetOrder(importedOrder.Id); // 5. Release the order await orderManager.ReleaseOrder(importedOrder.Id); ``` **REST** ```http # 2. Import the order POST /api/orderManager/orders/import Content-Type: application/json {  "externalSystemId": "ERP-2026-001284",  "orderNumberExternal": "ERP-2026-001284",  "orderName": "Bedroom & bathroom 01",  "customerNumber": "462642",  "source": "OrderConfigurator",  "orderDate": "2026-11-19T00:00:00Z",  "deliveryDatePlanned": "2026-12-03T00:00:00Z",  "items": [ ... ] } 200 OK { "correlationId": "0e4ea3b8-d1ce-4d16-a18f-9ea8f2e7d55c" } # 3. Check the import status (Queued, InProgress, Succeeded, Error) GET /api/orderManager/orders/import/0e4ea3b8-d1ce-4d16-a18f-9ea8f2e7d55c 200 OK {  "orderId": "1f5d1f4d-2ab9-487a-8a17-2d6fd84fe228",  "state": "Succeeded",  "errorDetails": null,  "link": "https://..." } # 4. Read the created order GET /api/orderManager/orders/1f5d1f4d-2ab9-487a-8a17-2d6fd84fe228 # 5. Release the order PATCH /api/orderManager/orders/1f5d1f4d-2ab9-487a-8a17-2d6fd84fe228/release 204 No Content ``` ## Update an Order by Importing It Again If an order changes in the source system before release—for example, if positions are added or changed—import the complete order again. Set `externalSystemId` to the order's identifier in your source system, such as its ERP order number, and use the same value for every import of that order. - If no order with this `externalSystemId` exists yet, the import creates a new order. - If an order with the same `externalSystemId` exists in the `New` state, the import overwrites the complete order, including groups, positions, and prices. - If the order is in the `NewInCalculation` state, the import ends with the `Error` status because the order is not ready yet. Import it again later. - If the order has already been released or is in production (`ReadyForProduction`, `InProgress`, or `Completed`), it can no longer be overwritten. The import ends with the `Error` status. To import a released order again, reset its release first. > **Warning:** Use a unique `externalSystemId` for each order. If two different orders are imported with the same value, the second import overwrites the first order. If you omit `externalSystemId`, each import creates a new order. ## Option: Import with Files If the order references files that cannot be accessed through a URI, such as images, send the order data and files together in a `multipart/form-data` request. The order JSON belongs in a part named `order`. Each file belongs in its own part, whose name matches the file name referenced in the order's `additionalData`. This allows orderManager to associate each file with the correct reference. **C#** ```csharp order.AdditionalData = [    new AdditionalDataEntity    {        Name = "frontImage.png",        Category = "Surface",        Type = AdditionalDataType.Image    } ]; var fileReferences = new[] {    new FileReference("frontImage.png", new FileInfo(@"C:\Exports\frontImage.png")) }; var response = await orderManager.ImportOrderRequest(order, fileReferences); ``` **REST** ```http POST /api/orderManager/orders/import Content-Type: multipart/form-data; boundary=boundary --boundary Content-Disposition: form-data; name="order" { "orderNumberExternal": "ERP-2026-001284", "additionalData": [ { "name": "frontImage.png", "category": "Surface", "type": "Image" } ], ... } --boundary Content-Disposition: form-data; name="frontImage.png"; filename="frontImage.png" Content-Type: image/png --boundary-- 200 OK { "correlationId": "0e4ea3b8-d1ce-4d16-a18f-9ea8f2e7d55c" } ``` ## Alternative: Import a Project Archive If your system already creates project archives for HOMAG software, you can send the ZIP file as the request body with `Content-Type: application/octet-stream`. This is supported but is not the standard method. Use JSON for new integrations. Steps 3 through 5 remain the same. **C#** ```csharp var response = await orderManager.ImportOrderRequest(new FileInfo(@"C:\Exports\Project.zip")); ``` **REST** ```http POST /api/orderManager/orders/import Content-Type: application/octet-stream 200 OK { "correlationId": "0e4ea3b8-d1ce-4d16-a18f-9ea8f2e7d55c" } ``` ## Integration Architecture Trigger the import through an event in the source system—for example, when an order is confirmed in the ERP system or a customer completes an order in a configurator. Set `source` to identify the originating system. If omitted, orderManager records `HG Connect`. Pass your own order number as `orderNumberExternal` and a stable `externalSystemId` so later changes can be transferred by importing the order again. Store the `orderId` returned by the import status with the order in the source system. Check the import status, not just the HTTP status of the import request: a request may be accepted even if the import itself fails. Display `errorDetails` in the source system so users can correct the data and import it again. ## Benefits - Orders reach orderManager immediately without manual entry. - Groups, positions, and prices are transferred along with the order header. - Changes before release are transferred by importing the order again, without creating duplicates. - Images and other files can be transferred together with the order. - The source system knows whether the import succeeded and why it failed. > **API reference:** See Endpoints → HOMAG Connect orderManager → Orders: [Import an order](https://docs.homag.cloud/apidocs/api-ordermanager-orders-import) ([`POST /api/orderManager/orders/import`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-orders/POST/api/orderManager/orders/import)), [Get import status](https://docs.homag.cloud/apidocs/api-ordermanager-orders-import-correlationid) ([`GET /api/orderManager/orders/import/{correlationId}`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-orders/GET/api/orderManager/orders/import/{correlationId})), [Get an order](https://docs.homag.cloud/apidocs/api-ordermanager-orders-id) ([`GET /api/orderManager/orders/{id}`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-orders/GET/api/orderManager/orders/{id})), and [Release an order](https://docs.homag.cloud/apidocs/api-ordermanager-orders-orderid-release) ([`PATCH /api/orderManager/orders/{orderId}/release`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-orders/PATCH/api/orderManager/orders/{orderId}/release)). More examples are available on [GitHub](https://github.com/HomagGroup/HOMAG-Connect/tree/main/Applications/OrderManager/Samples/CSharp/Orders/Import).