# When to calculate tax

Source: https://developer.avalara.com/avatax-dm-combined-erp/sales-tax-badge/design-transaction-workflow/calculating-tax/

# When to calculate tax

Getting a tax calculation is the primary reason developers use the Avalara AvaTax Service, and [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/) is the starting point.

But when will you collect tax? The answer varies from system to system, but in general, you should balance between efficient use of the API and when tax is required by the transaction workflow of the application.

**Advice:**

-   Be sure that your system is not calling tax every time a line is added or changed as this can drive up usage.
-   If you need to provide a quote, an easy way to accomplish this is with rate tables. For example, on the client side, you calculate the amount using: zip code × rate  based on the zip rate lookup. The amount × the rate = the estimated tax. More information is available in the [DownloadTaxRatesByZipCode](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/TaxContent/DownloadTaxRatesByZipCode/) endpoint.
-   You might also consider providing an explicit **Calculate Tax** button, or simply calculate tax automatically prior to saving the document.

[Previous](/avatax-dm-combined-erp/sales-tax-badge/design-transaction-workflow/credit-memos-without-posting)

[Next](/avatax-dm-combined-erp/sales-tax-badge/design-transaction-workflow/when-to-commit)