--- title: "Use Case: Calculate Prices" slug: "datenaustausch-connect-api-uc-om-preise" updated: 2026-12-02T08:12:53Z published: 2026-12-02T08:12:53Z canonical: "docs.homag.cloud/datenaustausch-connect-api-uc-om-preise" --- > ## 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: Calculate Prices **For:** Customers · Partners · Integrators A configurator, online shop, or sales tool needs a reliable price for a configured order, calculated using the same rules as orderManager. ## Challenge If each sales channel calculates prices using its own logic, the same product can have different prices in the shop, quote, and order. Maintaining pricing rules in multiple places is error-prone and expensive. ## Solution The sales application sends the order data to orderManager and receives it back with calculated prices. The calculation uses the pricing rules from a **price library** in orderManager. Pass the price library in `libraryId`. If `libraryId` is omitted, orderManager uses the subscription's default price library. The response always contains the `libraryId` used. Specify the price library explicitly to make the result predictable. > **Note:** `libraryId` must refer to a price library. If it refers to another library, such as a configuration library, the response contains an error in `errors`. | Endpoint | Purpose | | --- | --- | | `GET /api/pos/libraries/{libraryId}/articles` | Read a library's items, for example to display the assortment. | | `GET /api/pos/libraries/{libraryId}/masterData` | Read a library's master data: the available modules and attributes used to describe items. | | `GET /api/pos/libraries/{libraryId}/calc.js` | Read a library's calculation script, for example to provide an instant price preview in the sales application. | | `POST /api/price/calculate` | Calculate prices for the submitted order data. | ## Workflow 1. Read the library's items and master data to build the product selection in the sales application. 2. Create the order data from the customer's selection: groups and positions with item numbers, quantities, dimensions, and configuration data. 3. Send the order data together with the price library's `libraryId` to `POST /api/price/calculate`. 4. Check `errors` and `warnings`. If there are no errors, use the prices in `orderData`. 5. Import the priced order if the customer confirms it. See [Use Case: Import Orders](/docs/en/datenaustausch-connect-api-uc-om-import). **C#** ```csharp var priceClient = new PriceClient(subscriptionId, authorizationKey); var request = new PriceRequestData {    LibraryId = "MyPriceLibrary",    OrderData = new OrderDetails    {        OrderName = "Quotation 2026-118",        CustomerNumber = "462642",        Items =        [            new Group            {                Name = "Kitchen",                Items =                [                    new Position { Name = "P 01", ArticleNumber = "67839", Quantity = 2, Width = 600, Height = 720, Depth = 560 }                ]            }        ]    } }; var result = await priceClient.CalculatePrice(request); if (result.Errors.Count > 0) {    throw new InvalidOperationException(string.Join(Environment.NewLine, result.Errors)); } var pricedOrder = result.OrderData; ``` **REST** ```http POST /api/price/calculate Content-Type: application/json {  "libraryId": "MyPriceLibrary",  "orderData": {    "orderName": "Quotation 2026-118",    "customerNumber": "462642",    "items": [ ... ]  } } 200 OK {  "orderData": { "orderName": "Quotation 2026-118", "items": [ ... ] },  "libraryId": "MyPriceLibrary",  "errors": [],  "warnings": [] } ``` ## Option: Read Library Data Read a library's items and master data to display the assortment and available attributes in the sales application. **REST** ```http GET /api/pos/libraries/MyLibrary/articles GET /api/pos/libraries/MyLibrary/masterData GET /api/pos/libraries/MyLibrary/calc.js ``` ## Integration Architecture Call the price calculation from the sales application's backend, not from the browser, because the call requires the subscription credentials. Recalculate the price whenever the configuration changes and before importing an order so the imported order has the current price. The calculation returns HTTP `200` even if it fails: show `warnings` to the user and treat every entry in `errors` as a failed calculation. ## Benefits - The same price in every sales channel because all channels use the orderManager price library. - Pricing rules are maintained in one place. - Priced orders can be imported directly into orderManager. > **API reference:** See Endpoints → HOMAG Connect orderManager: [Calculate price](https://docs.homag.cloud/apidocs/calculates-the-price-for-the-given-order-data) ([`POST /api/price/calculate`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-price-calculation/POST/api/price/calculate)), [Get library items](https://docs.homag.cloud/apidocs/gets-the-library-articles) ([`GET /api/pos/libraries/{libraryId}/articles`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-point-of-sale/GET/api/pos/libraries/{libraryId}/articles)), [Get library master data](https://docs.homag.cloud/apidocs/gets-the-library-master-data) ([`GET /api/pos/libraries/{libraryId}/masterData`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-point-of-sale/GET/api/pos/libraries/{libraryId}/masterData)), and [Get the calc.js script](https://docs.homag.cloud/apidocs/gets-the-library-calc-js-script) ([`GET /api/pos/libraries/{libraryId}/calc.js`](https://connect.homag.cloud/ordermanager/#v1/tag/homag-connect-ordermanager-point-of-sale/GET/api/pos/libraries/{libraryId}/calc.js)).