Skip to content

Avalara AvaTax ​

Avalara AvaTax calculates sales, use, VAT, and other transactional taxes, and keeps a record of every taxable transaction your companies report.

ingestr supports Avalara AvaTax as a source.

URI format ​

The URI format for Avalara AvaTax is as follows:

plaintext
avalara://?account_id=<account_id>&license_key=<license_key>&environment=<environment>

URI parameters:

  • account_id: your AvaTax account ID.
  • license_key: the license key for that account.
  • environment (optional): production (default) or sandbox. Use sandbox for an account created on the AvaTax sandbox.
  • history_start (optional): the earliest transaction date to read, as YYYY-MM-DD. Defaults to 2000-01-01. Transactions with a document date before this are never read.

Setting up an Avalara AvaTax integration ​

ingestr authenticates with your account ID and license key. An account administrator can generate a license key in the AvaTax portal under Settings > License and API keys. Generating a new key invalidates the previous one, so share it with care. The user behind the key needs read access to the companies you want to ingest.

Here's a sample command that copies AvaTax transactions into a DuckDB database:

sh
ingestr ingest \
  --source-uri 'avalara://?account_id=1100012345&license_key=your-license-key' \
  --source-table 'transactions' \
  --dest-uri duckdb:///avalara.duckdb \
  --dest-table 'avalara.transactions'

Tables ​

TablePKInc KeyInc StrategyDetails
companiesid–replaceThe companies in the account.
transactionsidmodifiedDatemergeTransactions for every company in the account. lines (with their jurisdiction details) and summary are kept as JSON columns.
nexusid–replaceNexus declarations for every company.
tax_codesid–replaceCustom tax codes your companies have defined. Avalara's built-in system tax codes are not included.
itemsid–replaceThe item catalog for every company.

Use these exact names as the --source-table parameter in the ingestr ingest command.

Transactions ​

transactions reads each company in the account in turn. --interval-start and --interval-end select transactions by modifiedDate, so a run picks up everything created or changed in that window; without them, every transaction dated on or after history_start is read. Voided, adjusted, and uncommitted documents are kept along with their status, so filter on status (for example Committed) when you only want reportable documents.

For example, to load the transactions changed in January 2024:

sh
ingestr ingest \
  --source-uri 'avalara://?account_id=1100012345&license_key=your-license-key&history_start=2020-01-01' \
  --source-table 'transactions' \
  --dest-uri duckdb:///avalara.duckdb \
  --dest-table 'avalara.transactions' \
  --interval-start '2024-01-01' \
  --interval-end '2024-02-01'