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.
The price type also governs the price for sale the fetched entities report. For a product with variants (the
LOWEST_PRICEinner record handling), the
variant that sells the product, the bounds of its price range and the accompanying prices of that variant are chosen
by the amounts of this price type - so the entity reports the very price the query filtered and sorted it by. This
holds also when the price for sale is requested with an explicit currency, time and price lists on an entity fetched by
the query.
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.
Within a single entity fetch, one accompanying price name must be requested consistently: either every requirement
for it defers to this default, or every one of them names its own price lists. A pair that mixes the two is refused
even when the default currently resolves to the very same price lists - see
folding accompanyingPriceContent per price name.