# Price logic

In the IDM format the base prices and additional prices of an item are contained inside the item itself. One item can contain multiple prices, based on the market where it is being commercialised. This data is extracted from the ItemPrice data field and saved into a DTO with a unique id, composed of:

```
"articleNumber"_PG"priceFeatureGroupNo"_PF"priceFieldNo"
```

Where the artice number is the SerieNo\_ItemNo

For example:

```
5_2098_PG1_PF5
```

If the price inside the priceField is 0, the price is not added. Also both the addition of the subcomponent and of the logic in the onUpdate are skipped, if the price is not added.

For each PRICE\_FEATURE\_GROUP a subcomponent is created, which references the priceGroup( either base or additional with the Id). In the subcomponents the self reference to the main component with numberInPartlist = 1 is also added.

The logic behind the calculation of prices, (option surcharges, which can be either fixed price surcharges or percentage price surcharges) is contained in the PRICE\_DEFINITION part of the IDM XML file and referenced from the items. This logic is added to the OnUpdate, while sending the prices (price fields) to the price service.

If a PRICE\_FEATURE\_GROUP\_NO and FEATURE\_NO are used in the configuration, the price contained in the referenced priceField is used as surcharge. The FINISH data field contains the conditions for the use of a specific price field (OPTION\_REF), with the value for the condition being contained in the OPTION\_KEY attribute. Currently only the fixed price surcharges are converted. The percent surcherges use a similar referencing and condition system. Instead of using the FINISH data field, they use the PERCENTAGE\_SURCHARGE data field, with a PRICE\_FACTOR. They require a calculation , sometimes based on base price and sometimes on price with fixed price surcharges (some or all).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roomle.com/rubens/content-creation/idm/idmpricelogic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
