Setting Up Tax Data Retrieval From AvaTax
Some countries, like the United States or Canada, have very complex sales tax rules that are difficult to manage. JustOn allows for retrieving tax data from an external tax provider.
Info
The tax data retrieval is available as of JustOn 2.43.
JustOn supports the AvaTax service from Avalara as external tax provider. For technical details about the AvaTax service integration, see AvaTax Implementation Details.
Info
For general information about JustOn's tax capabilities, see JustOn Tax Handling.
Working With Avalara Tax Codes
Generally, Avalara associates tax codes to tax rules, which determine the applicable taxes for an invoice line item. Avalara has predefined tax codes with a taxability profile in place for all US states. You can, however, add custom tax rules, which involves adding jurisdictions, tax codes and items.
If your business uses custom tax rules and therefore manages items in Avalara, you must, consequently, configure your invoice line items to specify an Avalara tax code. There are two ways to do so:
Using Item Codes
In Avalara, you can manage items and item codes, and then map items to tax codes. Doing so, supports the following workflow:
(1) Manage item codes in Avalara.
(2) Create the field ON_ItemCode__c
on the Invoice Line Item object.
(3) Use the field ON_ItemCode__c
of the invoice line item to set the corresponding item code defined in Avalara.
(4) Avalara determines the tax code to apply via your defined item-tax code mapping.
Directly Passing Tax Codes
Alternatively, you can specify the tax code directly:
(1) Manage tax codes in Avalara.
(2) Use the field TaxCode__c
of the invoice line item to set the intended Avalara tax code.
Note
Omitting or using the wrong tax code may result in an incorrect tax calculation.
Configuring AvaTax Access
The AvaTax module uses a Named Credential to access the AvaTax service.
Info
Prior to using AvaTax, your organization must create a user account at Avalara, which is subject to a (chargeable) contract.
To add a named credential for your AvaTax account:
-
In Setup, open Named Credentials.
In Salesforce Lightning, navigate to Security > Named Credentials.
In Salesforce Classic, navigate to Security Controls > Named Credentials.
-
Click New Named Credential.
- Enter AvaTax as short label and name.
-
Specify the AvaTax base URL:
- SANDBOX: https://sandbox-rest.avatax.com/
- PRODUCTION: https://rest.avatax.com/
-
Select the Identity Type
Named Principal
. - Select the Authentication Protocol
Password Authentication
. - Enter the user name and password for your AvaTax account.
- Make sure that
Generate Authorization Header
is selected. - Click Save.
Configuring AvaTax Tax Provider
General Configuration
The external tax provider is configured as part of the business entity settings.
Note
Be aware that when using external tax providers like AvaTax
, you must specify the complete address information for the business entity.
-
In Setup, open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of Business Entity.
- Click Edit the row of the business entity you intend to edit.
-
In the
Tax Provider
field, specify{"Provider":"AvaTax"}
.The field
Tax Provider
uses the JSON format. This allows for passing additional options. -
Click Save.
Additional Options
AvaTax supports multiple companies per organization account, that is, a registered (sub) division of your organization (similar to the JustOn business entity).
In addition, you can enable or disable the automatic generation of an invoice document record upon invoice finalization. If it is disabled, JustOn retrieves the tax details from AvaTax, but no document will show up in the AvaTax portal.
Note
The document record generation in AvaTax is disabled by default.
The field Tax Provider
uses the JSON format. This allows for passing additional options, like specifying the AvaTax company code. The available options include:
Option | Value | Descrption | Default Value | Example |
---|---|---|---|---|
CompanyCode |
<company code> |
Specifies the AvaTax company code, DEFAULT if left empty |
DEFAULT |
"CompanyCode":"MyCompany" |
Record |
true or false |
Determines whether to create a document record in AvaTax | false |
"Record":true |
To enable the document recording in AvaTax, specify the following JSON expression in the Tax Provider
field:
{"Provider":"AvaTax","Record":true}
To specify an AvaTax company, use the tax provider option CompanyCode
, like
{"Provider":"AvaTax","CompanyCode":"MyCompany"}
Using Billing Address for Tax Calculation
Usually, the shipping address of a buyer is the relevant location for the tax origin – it determines which tax to apply. This is why JustOn matches the fields Invoice Region
, Invoice Country
and Invoice State
against the shipping address fields of the invoice by default.
Certain business use cases, however, use the billing address to fix the tax. To support this, you can tell JustOn to match Invoice Region
, Invoice Country
and Invoice State
against the billing address fields.
Info
Contact your tax consultant to determine the appropriate way for your business.
-
In Setup, open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of Global Settings.
- Click Edit in the Default row.
- Select the checkbox
Use Billing Address for Tax
. - Click Save.
Note
This is a global option that cannot be reversed for a single invoice, subscription or account.