# When should I calculate tax?

Source: https://developer.avalara.com/goods-calculation-en/gkk5333282670122/

# When should I calculate tax?

Learn when to call AvaTax Brazil to calculate tax in your transaction workflow.

Getting a tax calculation is the main reason why developers use AvaTax Brazil. It doesn’t matter if you’re just looking to obtain a tax rate for a purchase or sale budget, or if you’re looking to effect a transaction and save it in our database. At the moment you call our calculation engine, we’ll return the transaction and the taxes involved in it.

So when you're designing your transaction workflow, when should you calculate tax? In general, the answer is to call the tax when you want to calculate taxes naturally. Specifically for ecommerce, you’ll want to show taxes in the checkout workflow, which occurs after the user enters their billing and shipping information.