Tax-Inclusive Pricing
In this document, you’ll learn about tax-inclusive pricing and how it's used during prices calculation.
What is Tax-Inclusive Pricing?#
A tax-inclusive price is a price that includes taxes. The tax amount is calculated from the price rather than added to it.
For example, if a product’s price is $50 and the tax rate is 2%, then the tax-inclusive price is $49, and the applied tax amount is $1.
How is Tax-Inclusive Pricing Set?#
The PricePreference
data model holds the tax-inclusive setting for a context. It has two properties that indicate the context:
attribute
: The name of the attribute to compare against. For example,region_id
orcurrency_code
.value
: The attribute’s value. For example,reg_123
orusd
.
The is_tax_inclusive
property indicates whether tax-inclusivity is enabled in the specified context.
For example:
In this example, tax-inclusivity is enabled for the USD
currency code.
Tax-Inclusive Pricing in Price Calculation#
Tax Context#
As mentioned in the Price Calculation documentation, The calculatePrices
method accepts as a parameter a calculation context.
To get accurate tax results, pass the region_id
and / or currency_code
in the calculation context.
Returned Tax Properties#
The calculatePrices
method returns two properties related to tax-inclusivity:
is_calculated_price_tax_inclusive
: Whether the selectedcalculated_price
is tax-inclusive.is_original_price_tax_inclusive
: Whether the selectedoriginal_price
is tax-inclusive.
A price is considered tax-inclusive if:
- It belongs to the region or currency code specified in the calculation context;
- and the region or currency code has a price preference with
is_tax_inclusive
enabled.
Tax Context Precedence#
If:
- both the
region_id
andcurrency_code
are provided in the calculation context; - the selected price belongs to the region;
- and the region has a price preference
Then, the region’s price preference’s is_tax_inclusive
's value takes higher precedence in determining whether a price is tax-inclusive.