Skip to main content
Avalara Help Center

Create and manage advanced tax rules

This article applies to:AvaTax

Use advanced tax rules to modify your transactions as they come into AvaTax.

Create a rule to assign location codes to marketplace transactions

Some online marketplaces collect and remit tax on your behalf. Use advanced tax rules to label these transactions so that AvaTax knows you don't need to remit tax on these transactions. Make absolutely sure that the rules you set up are targeting only your marketplace transactions. Rules that are too broad may lead to incorrect reporting tax reporting on your returns.

If you use a data extractor to bring your marketplace sales into AvaTax, you don't need to set up any advanced rules for that marketplace. The extractor takes care of that for you.

Before you start, create a marketplace location for each online marketplace used by your company, if you haven't already done so. Then, add rules to add those location codes to marketplace transactions as they come into AvaTax.

Setting up criteria for advanced rules

Advanced rules can be customized in dozens of different ways. Use the conditions in the WHEN section to determine when the changes in the THEN section are applied to transactions.

To set up your rules criteria, choose a field, select the type of comparison you want to make, and enter one or more values. Use multiple fields in each set of rule criteria for the most accurate results.

The Field dropdown contains all of the different pieces of information you can use to build your rule criteria. These are compared against the contents of one or more Value fields to determine if the rule should be applied to any given transaction. For example, if you're making a marketplace rule and you know that all the items you sell on Amazon contain the word "Amazon" in their item code, create a rule that checks the ItemCode field for that word.

Available fields

Field name Definition
CompanyCode The code used to identify a company in AvaTax. If you know that all of the transactions you want to target with a rule are behind handled by a specific subsidiary company, use this field in your rule criteria.
CustomerCode A code identifying a specific customer in your accounting software.
LocationCode A code used to identify a location that your company sells from. This is useful when your business application assigns location codes to transactions that you want to target with a rule in AvaTax.
ItemCode A code identifying the item or service being sold. If the transactions you're targeting with a rule all include item codes that are never included in other transactions, use this field in your rule criteria.
SalespersonCode A code that your business application may use to track information that AvaTax doesn't normally pay attention to. If your business application passes AvaTax a salesperson code, you can use that in rules to help identify transactions.
ShipFromState The origin state for the transaction.

The delivery state for the transaction. If the transaction happened at a store, then this is the same as the ShipFromState field.

For marketplace rules, this is the field that lets you constrain the rule to states with marketplace fairness laws.

PurchaseOrderNo This field holds information that your business application may pass to AvaTax but which AvaTax doesn't normally track. Depending on how your business application works, you may be able to use this field for more accurate targeting of transactions.
ReferenceCode This field holds information that your business application may pass to AvaTax but which AvaTax doesn't normally track. Depending on how your business application works, you may be able to use this field for more accurate targeting of transactions.

If a field matches any of the values assigned to it, then the field is true. If all fields on a rule set are true, then the rule applies whatever changes are listed in the WHEN section of the rule.



The above rule triggers when a transaction shipping into Connecticut has a line item with an item code that includes the word "AMAZON" or "AMZN."

Values aren't case sensitive, so enter information into them in with whatever capitalization makes sense to you.

The ShipFromState and ShipToState fields can accept both the full name of the state (example: "Washington") or the two-letter abbreviation (example: "WA") as values. However, if AvaTax receives a transaction with a shipping state in a different format than you used to set up the rule (for example, a transaction using "Arizona" as the state when you've set up the rule with "AZ"), then the rule won't trigger. When you're setting up your rule criteria, make sure to use whichever format your accounting software uses. If you're not sure, create a rule criteria that covers both possible formats.

Click Add value to compare a field to more than one value, or Add criteria to create a new condition that must also be true for the rule set to take effect. By combining multiple criteria, values, and rule sets, you can create complex conditions to cover a wide array of scenarios.

Edit advanced rules

The criteria and output of advanced tax rules can be edited by going to Settings > All AvaTax Settings, clicking Manage next to Custom Rules, and clicking the Advanced Rules tab. Click on the rule you want to edit in the list. If you can't find the rule you're looking for, use the filters at the top of the list to sort by active or inactive rules.

Troubleshooting problems with your rules

If you discover that an advanced rule you made doesn't seem to be working:

  1. Make sure that the rule is active. Settings > All AvaTax Settings, click Manage next to Custom Rules, and then click Active to see the list of all active rules. If the one you're looking for isn't there, click Inactive and find it in the inactive rule list. Edit the rule, check the box marked Yes, apply this rule to transactions, and then click Save advanced tax rule. The rule is now applied to transactions coming into AvaTax, and to any transaction that you edit and save.
  2. Make sure that the values used in the rule criteria are spelled correctly
  3. Make sure that the transactions you want the rule to affect match all of the criteria for the applicable rule set. For a rule set to apply to a transaction, the transaction must match every criteria under the WHEN heading for that set.
  4. After making adjustments to your rule, send a test transaction that matches the rules you're troubleshooting to see if the problem has been resolved. Once more transactions have come in, run a Tax Summary by Marketplace Location report to make sure that all of the relevant transactions are being targeted by your rule.
  • Was this article helpful?