Skip to content

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:

  1. In Setup, open Named Credentials.

    In Salesforce Lightning, navigate to Security > Named Credentials.

    In Salesforce Classic, navigate to Security Controls > Named Credentials.

  2. Click New Named Credential.

  3. Enter AvaTax as short label and name.
  4. Specify the AvaTax base URL:

    • SANDBOX: https://sandbox-rest.avatax.com/
    • PRODUCTION: https://rest.avatax.com/
  5. Select the Identity Type Named Principal.

  6. Select the Authentication Protocol Password Authentication.
  7. Enter the user name and password for your AvaTax account.
  8. Make sure that Generate Authorization Header is selected.
  9. Click Save.

Configuring AvaTax Tax Provider

General Configuration

The external tax provider is configured as part of the tenant settings.

Note

Be aware that when using external tax providers like AvaTax, you must specify the complete address information for the tenant.

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Tenant.

  3. Click Edit the row of the tenant you intend to edit.
  4. In the Tax Provider field, specify {"Provider":"AvaTax"}.

    The field Tax Provider uses the JSON format. This allows for passing additional options.

  5. Click Save.

Additional Options

AvaTax supports multiple companies per organization account, that is, a registered (sub) division of your organization (similar to the JustOn tenant).

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

By default, JustOn matches the fields Invoice Region, Invoice Country and Invoice State against the shipping address fields of the invoice. This is useful if you sell non-digital goods and use the shipping address fields to determine the physical location of the buyer.

If you sell digital goods, however, and use the billing address only, you can tell JustOn to match against the billing address fields:

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Use Billing Address for Tax.
  5. Click Save.

Note

This is a global option that cannot be reversed for a single invoice, subscription or account.