--- title: "Best practices" slug: "datenaustausch-connect-api-uc-pm-best-practices" updated: 2026-12-02T08:12:45Z published: 2026-12-02T08:12:45Z canonical: "docs.homag.cloud/datenaustausch-connect-api-uc-pm-best-practices" --- > ## 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. # Best practices **For:** Customers · Partners · Integrators Practical tips for a robust productionManager integration. ## Use the right identifiers Two identifiers serve different purposes: | Identifier | Set by | Use it to | | --- | --- | --- | | `orderId` | productionManager, returned in the import status | Read, update, release, and delete the order. Store it with the order in your system. | | `ExternalSystemId` | Your system, in `project.xml` | Identify repeated imports. An import with the same value overwrites the existing order while its status is `New`. | Use a unique `ExternalSystemId` for each order, for example the ERP order number. If two different orders use the same value, the second import overwrites the first order. Also ensure that each part in an import has a unique identifier: duplicate part identifiers can cause parts to be mixed up in production. ## Take the order status into account What you can do with an order depends on its status: | Status | Meaning | Consequence for integrations | | --- | --- | --- | | `New` | Imported, not yet released | The order can be overwritten by importing it again, and header data can be changed with `PATCH`. | | `ReadyForProduction` | Released for production | Header data can still be changed with `PATCH`. Re-imports end with import status `Error`. The release can be reset. | | `InProduction` | Production has started | Header data changes are rejected, and re-imports end with import status `Error`. | | `Completed` | Production is complete | Header data changes are rejected, and re-imports end with import status `Error`. | Transfer changes to parts before releasing an order. Header data can still be changed until production starts. ## Handle errors explicitly | Status | Meaning | Typical cause | | --- | --- | --- | | `200 OK` / `204 No Content` | Request succeeded | - | | `400 Bad Request` | Request was rejected | Invalid parameter value, for example an unknown `orderStatus`, or `daysBack` combined with `from`/`to` | | `401 Unauthorized` | Missing or invalid credentials, or no valid license | Incorrect subscription ID, revoked authorization key, inactive add-on | | `404 Not Found` | Requested object does not exist | Unknown order ID | | `422 Unprocessable Entity` | Request is syntactically valid but invalid | Missing parameters, invalid paging values, unknown IDs, order still assigned to a lot, part already assigned to a lot | > **Warning:** Do not automatically retry responses with `400`, `401`, or `422`. They indicate a configuration or data issue that a retry will not fix. For imports, also check the import status: a request can be accepted while the import itself ends with status `Error`. `errorDetails` explains why. ## Query efficiently - Poll the import status at short, increasing intervals, and stop when the status is `Succeeded` or `Error`. - Synchronize order status on a schedule, for example every few minutes, and read only orders that have not yet been completed. - Read production data incrementally: remember the end of the last time window and use it as the beginning of the next one. ## Use time windows and paging correctly - Always specify the time window, either with `daysBack` or with `from` and `to`, never both. If you set `from` without `to`, entries for the current day may be missing. - Without a time window, the production protocol returns the last 14 days and rework statistics return the last three months. - Retrieve large results in pages using `take` and `skip`. The maximum `take` value is `1000` for orders and lots, `9999` for the production protocol, and `10000` for feedback and rework statistics. ## Request localized output only for people Use `format=localized` only when people will read the result directly, for example in Excel or Power BI. Localized output translates property names and values. Omit the parameter for system-to-system integrations and use the stable technical schema. ## Keep credentials on the server Credentials identify a subscription, not a person. Call the API only from trusted backend systems, and never embed credentials in browser applications, mobile apps, or public repositories. ## Checklist - Store the `orderId` of every imported order. - Set a unique `ExternalSystemId` for every order and a unique identifier for every part. - Transfer changes to parts before releasing an order and header changes before production starts. - Check the import status, not just the HTTP status of the import request. - Do not retry responses with `400`, `401`, and `422`. - Specify time windows, use `take`/`skip` for paging, and read incrementally. - Keep credentials on the server.