> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/pricing-advisor-api/resources/calculate-final-prices.md).

# Calculate Final Prices

## Pricing Advisor Calculations in v4.0 <a href="#pricing-advisor-calculations-in-api-v4.0" id="pricing-advisor-calculations-in-api-v4.0"></a>

Using the API response values, calculate the estimated product price in the shopper currency. The final price is the price displayed to the shopper at checkout.

Calculating the final product price is a two-step process – first, you must calculate the estimated price in the shopper currency, and then, apply rounding to get the final price.

{% hint style="info" icon="calculator" %}
$$((((base price × (1 + retailerAdjustment/100)) × (1 + estimatedDuty/100)) × (1 + taxPercentage/100)) × (1 + feePercentage/100)) × fxRate = shopper currency price → round = final price$$
{% endhint %}

{% @code-walkthrough/html-renderer aspectRatio="1.5" htmlZ0="H4sIAAAAAAAAA-1cX3PbNhJ\_96fYcs6lVZsSJVuJo4hqUyeey0zdy6Tt3N1k8gCRSwkxCHBAyJKaZuae7gPc3He59\_so\_SQ3AEiJpChLdppre-c-OCSwu1jsn98CFNDhZ8\_\_dPH9X1-9gKlK2OhgqP8BRvgkcJA7ugFJNDoYJqgIhFMiM1SB88P3l965UzRzkmDg3FCcp0IqB0LBFXIVOHMaqWkQ4Q0N0TMvJ0A5VZQwLwsJw6Db9rUYRRXD0StJQ8on8Cy6oZmQcHPW9uGCsHDGiBJy2LFkBwfDzzwPLgSP6QSufvjuexgjRBhTjhGMMRYSQU0RLp5\_C1koaaogExAReT0AOWOYAZEIE-QoicIIPG90MLSEowOAOeWRmLcVoUw\_QgDvDwBATyumk0H-BkbglYhwAG7ISJa5J3mHmmKCazoAXCjkUbkFIBZcXZKEsmW1HSARXAzgjes8v4IrwYXjnoCrG7OUhOi-PalQZ4RnBfV3hGeGWjd6GUoaV8k\_HNSf7L\_674eDYacwwrAwmwwDZ6pUmg06nTDiK6OEWdYOReKM1jwHQ0b5NUwlxmsePcusPRFiwpCk1DB1wizrfRmbuQfPr471HAfz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lzcZG65crWa1V0K\_kRtspYERWSyhLycrKd2xA0ctp0v4VTEzRxSqLBwHjlCzjqwrH2R6fr-63iXXuh0qDIovIeIxbv8aIiO1-1BbWaL8l8R8XfsMo3ZIxse8UtvQzKNKZy6377MAC32ES6cGwJN8y4GmqzlMBqKPMyKNPsGEoT2qG2-6i0gXJbbb2Eu7D3wouJW9WOwW2vZJqmSpSz2-KgtAguMgtZbajcbZXkXpGapeg3NFNtiYm4wSPX3MwshN0IGmkyEccZqj\_r66sNrCSKKnxV1Khcs8vBY-uELIrYuLYoF4Brb2y4O-xt8KbMqVn7u7gsKG0MuIvNAFZ9sN5OHQ2ubbC1d2oZ10czWra757sYSyBXGnCnUeqwprnyHzR28VZArRjRJNEuxjKmNTDa6rOKr-K1dGe\_o-8Km7vD-n\_l8B89YG4c2kEAAA" htmlZN="2" %}

### **Calculating Estimated Prices** <a href="#calculating-estimated-prices" id="calculating-estimated-prices"></a>

| Field                          | Value  |
| ------------------------------ | ------ |
| Base price (retailer currency) | 120.00 |
| `retailerAdjustment`           | 5%     |
| `estimatedDuty`                | 12%    |
| `taxPercentage`                | 20%    |
| `feePercentage`                | 2.5%   |
| FX rate                        | 1.18   |

Using the API response values, perform the following steps to calculate the estimated product price in the shopper currency.

{% stepper %}
{% step %}

#### Apply retailer adjustment

The base price is in the retailer currency and excludes any charges, such as duties and taxes.

{% hint style="info" icon="calculator-simple" %}
$$price\_adj = base × (1 + retailerAdjustment / 100) = 120.00 × (1 + 5 / 100) = 120.00 × 1.05 = 126.00$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply estimated duty

Calculate the price with duty by multiplying the Price adjustment with `estimatedDuty`.

{% hint style="info" icon="calculator-simple" %}
$$price\_duty = price\_adj × (1 + estimatedDuty / 100) = 126.00 × (1 + 12 / 100) = 126.00 × 1.12 = 141.12$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply tax

Calculate the price with tax by multiplying the Price with duty with `estimatedTax`.

{% hint style="info" icon="calculator-simple" %}
$$price\_tax = price\_duty × (1 + taxPercentage / 100) = 141.12 × (1 + 20 / 100) = 141.12 × 1.20 = 169.34$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply fee

Calculate the price with fee by multiplying the Price with tax with the `estimatedFee`

{% hint style="info" icon="calculator-simple" %}
$$price\_fee = price\_tax × (1 + feePercentage / 100) = 169.34 × (1 + 2.5 / 100) = 169.34 × 1.025 = 173.58$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply FX rate

Apply the FX rate to the tax rate to convert it into the shopper currency.

{% hint style="info" icon="calculator-simple" %}
$$shopper\_price = price\_fee × fxRate = 173.58 × 1.18 = 204.82$$
{% endhint %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}

#### **Apply rounding** (2 decimal places, nearest) → **final price: `204.82`**

{% endhint %}

### **Rounding Prices** <a href="#rounding-prices" id="rounding-prices"></a>

Once the estimated price of the product is calculated, the next step is to apply rounding. The product prices are rounded based on the currency exponent, rounding direction, and rounding model.

* The currency exponent indicates what the price should be rounded to. If the currency exponent is 2, the price is rounded to 2 decimal digits. Similarly, if the currency exponent is 3, the price is rounded to 3 decimal digits.
* The rounding direction indicates if the price should be rounded up, down, or to the nearest number. None implies no rounding.
* The rounding model indicates how the minor currency values are displayed. The following table highlights some examples:

| **Starting Price** | **Rounding Direction** | **Rounding Model**    | **Rounded Value** |
| ------------------ | ---------------------- | --------------------- | ----------------- |
| 98.50              | Up                     | fixed100.fixed00      | 100.00            |
| 98.45              | Up                     | fixed100.multiple50   | 100.50            |
| 98.23              | Up                     | fixed100.none         | 100.23            |
| 98.50              | Up                     | multiple50.fixed00    | 100.00            |
| 128.50             | Down                   | multiple50.fixed00    | 100.00            |
| 98.26              | Up                     | multiple50.multiple50 | 100.50            |
| 128.76             | Down                   | multiple50.multiple50 | 100.50            |
| 151.50             | Up                     | multiple100.none      | 200.50            |
| 98.50              | Up                     | none.fixed00          | 99.00             |
| 98.30              | Up                     | none.multiple50       | 98.50             |
| 98.50              | Up                     | none.none             | 98.50             |

***

## Pricing Advisor Calculations in v3.0 and v2.0 <a href="#pricing-advisor-calculations-in-api-v3.0-and-v2.0" id="pricing-advisor-calculations-in-api-v3.0-and-v2.0"></a>

Calculating the final product price is a two-step process – first, you must calculate the estimated price in the shopper currency, and then second, apply rounding to get the final price using the formula

{% hint style="info" icon="calculator" %}
$$(((Product base price x (1 + priceUpliftPercentage)) x (1 + dutyPercentage)) x (1 + taxPercentage)) x fxRate = Price in the shopper currency → apply rounding = Final product price$$
{% endhint %}

This version uses three percentage steps instead of four — there is no separate fee step.

### Calculating Estimated Prices <a href="#calculating-estimated-prices.1" id="calculating-estimated-prices.1"></a>

| Field                          | Value |
| ------------------------------ | ----- |
| Base price (retailer currency) | 80.00 |
| `priceUpliftPercentage`        | 8%    |
| `dutyPercentage`               | 10%   |
| `taxPercentage`                | 25%   |
| FX rate                        | 1.25  |

Using the API response values, perform the following steps to calculate the estimated product price in the shopper currency.

{% stepper %}
{% step %}

#### Apply price uplift

{% hint style="info" icon="abacus" %}
$$price = base × (1 + priceUpliftPercentage / 100) = 80.00 × (1 + 8 / 100) = 80.00 × 1.08 = 86.40$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply duty

{% hint style="info" icon="abacus" %}
$$price\_duty = price × (1 + dutyPercentage / 100) = 86.40 × (1 + 10 / 100) = 86.40 × 1.10 = 95.04$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply tax

{% hint style="info" icon="abacus" %}
$$price\_tax = price\_duty × (1 + taxPercentage / 100) = 95.04 × (1 + 25 / 100) = 95.04 × 1.25 = 118.80$$
{% endhint %}
{% endstep %}

{% step %}

#### Apply FX rate

{% hint style="info" icon="abacus" %}
$$shopper\_price = price\_tax × fxRate = 118.80 × 1.25 = 148.50$$
{% endhint %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}

#### **Apply rounding** (2 decimal places, nearest) → **final price: 148.50**

{% endhint %}

### Rounding Prices <a href="#rounding-prices.1" id="rounding-prices.1"></a>

The product prices are rounded based on the currency exponent, which is the number of decimal places after the decimal point, rounding direction, and rounding model.

* Currency exponent indicates what the price should be rounded to. If the currency exponent is 2, the price is rounded to 2 decimal digits. Similarly, if the currency exponent is 3, the price is rounded to 3 decimal digits.
* Rounding direction indicates if the price should be rounded up, down, or to the nearest number. None implies no rounding.
* Rounding model indicates how the minor currency values are displayed, for example, 25, 50, and so on.

The following table highlights some rounding examples:

| **Starting Price** | **Rounding Direction** | **Model** | **Result** |
| ------------------ | ---------------------- | --------- | ---------- |
| 100.5              | Up                     | 99        | 100.99     |
| 100.2              | Up                     | 80        | 100.8      |
| 100.6              | Up                     | 75        | 100.75     |
| 100.8              | Up                     | 0         | 101        |
| 100.5              | Nearest                | 99        | 100.99     |
| 100.4              | Nearest                | 25        | 100.25     |
| 100.99             | Down                   | 0         | 100        |
| 100.67             | Down                   | 35        | 100.35     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.esw.com/pricing-advisor-api/resources/calculate-final-prices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
