> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Avalara Tax Settings

Avalara provides 2 different engines with which we are integrated:

* Avalara Avatax - The first one can be used by all merchants.
* Avalara Brazil - merchants must sign a dedicated contract with Avalara Brazil

## Avalara Avatax Tax Setting

The following credentials should be defined:

| Field | Required/Optional | Description | Valid values |
| - | - | - | - |
| stv\_av\_username | Optional | username - Credentials for connection to Avalara AvaTax.**Note:** for merchants using Vindicia's white label service, this doesn't need to be collected from the merchant | string |
| stv\_av\_password | | password - Credentials for connection to Avalara AvaTax. **Note:** for merchants using Vindicia's white label service, this doesn't need to be collected from the merchant | string |
| stv\_av\_host\_uri\_dev | Optional | These merchant options override the stack\_conf values for an Avalara sandbox URI if the merchant has a direct contract with Avalera. | Null - default value |
| stv\_av\_host\_uri\_prod | | These merchant options override the stack\_conf values for an Avalara production URI if the merchant has a direct contract with Avalera. | Null - default value |
| stv\_av\_company\_id | | The company ID the taxes will be recorded against. | string |
| stv\_av\_company\_code | | The company name the taxes will be recorded against. | |
| stv\_av\_deduced\_countries | | This allows for overriding the system settings regarding tax inclusion. When this option is null, the system will use US & Canada as price exclusive tax countries and all the others as price inclusive. This merchant option is a list of country codes, space-separated, which reverse that meaning. So "US DE" would use exclusive pricing in CA and DE, and inclusive pricing in the US and everywhere else. In addition, if the option begins with '\*', all countries are flipped . This allows setting all prices to tax-exclusive with "\* CA US", which otherwise would require listing every single country code. | Note - countries should be specified with a 2 letter code.The reason we need this is due to the fact that Avalara requires an extra field for tax-inclusive pricing. |

## Avalara Brazil Tax Settings

AvaTax does not support tax calculations for Brazil. Therefore, for merchants that do business in Brazil, they need to provide also some configuration for Avalera Brazil. Brazilian taxes are calculated when the merchant has AvaBrazil credentials and the "sales\_tax\_address" country is 'BR'. You can have in the same merchant configuration for both AvaTax and Avalara Brazil

**Note:** Merchants that want to use Avalara Brazil, must have a country defined for the Merchant

In order for the system to calculate taxes for Brazil, the following should apply:

* Every merchant customer must include a complete Brazilian address, including postalCode.( the three lines of the address must be filled.)

* Every merchant customer must have a named value "vin:BrazilTax.federalTaxId": 1234567890987654321

* Every taxable item should either leave the category empty or set it to "Service"

Merchant Configuration will include the credentials, and either a decision rule or the name value pairs - that will indicate the system to follow a separate path for Brazil addresses.

## Avalara Brazil Name-Value Pairs

| **Name** | **Value** |
| - | - |
| vin:BrazilTax.federalTaxId | A number representing the merchant Brazil federal tax id |
| vin:BrazilTax. companyLocation | \<need to check if we use this - i see an error on the name ( there is a space) |
| vin:BrazilTax.export | This setting controls who sends the tax data to the Brazilian government.- 0 or empty or missing altogether if the merchant sends the data. - 1 or most anything if they want us to tell Avalara Brazil to report the tax data |

## Decision Rule Format

Use the following format:

`DecisionRule type SalesTax_AvaBrazil`

IF \_.caller = 'calculate\_tax' AND \_.addr.country = 'BR' THEN rule = \{"header.entity.federalTaxId" => '12345678987654321',"lines.#.itemCode" => 'D100'} STOP

**Credentials:**

| Field | Required/Optional | Description | Valid values |
| - | - | - | - |
| stv\_avbrz\_username | Required | username - Credentials for the tax login | string |
| stv\_avbrz\_password | Required | password - Credentials for the tax login | string |
| stv\_avbrz\_host\_uri\_dev | Optional | These merchant options allows tp override the stack\_conf values | Can be left null |
| stv\_avbrz\_host\_uri\_prod | Optional | These merchant options allows tp override the stack\_conf values | Can be left null |

**Parent topic:**[Taxes](../topics/taxesAbout)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.