This chapter covers handling prices with or without tax for B2C and B2B scenarios, and how to set default price list priorities for consistent pricing across your queries.
Price type
argument:enum(WITH_TAX|WITHOUT_TAX)!
selection of the type of price that should be taken into account when calculating the selling price and
filtering or sorting by it
In B2C scenarios, prices are generally displayed with tax included to give consumers the total purchase cost upfront,
adhering to retail standards and regulations. For the B2B subset, displaying prices without tax is critical as it
aligns with their financial processes and allows them to manage tax reclaim separately.
That's why we need to control what type of price we're working with in our queries, since it would produce different
results for different settings. The priceType requirement allows us to do this.
The
requirement
controls which price type is used when calculating the sales price and filtering or sorting by it. If no such
requirement is specified, the price with tax is used by default.
To demonstrate the effect of this requirement, let's say the user wants to find all products with a selling price
between €100 and €105. The following query will do that:
The result contains some products, which you can see in the following table:
But if the user is a legal entity and can subtract the sales tax from the price, he probably wants to find all products
in this range with the price without tax. To do this, we need to modify the query and add the priceType requirement:
And now the result contains completely different products (in the output we show the price with tax to demonstrate the
difference - in regular UI you'd choose to show the price without tax) with more appropriate price for particular user:
Default accompanying price lists
argument:string+
A mandatory specification of one or more price list names in order of priority from most preferred to least
preferred.
The
requirement
defines prioritized list of price list names that will be used for all accompanyingPriceContent
requirements that don't specify their own price list sequence. This is useful when you want to specify a default rule
at the top level of your query, so that you don't have to repeat the same price list sequence in every
accompanyingPriceContent nested in entityFetch containers.