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.

Bruin supports Avalara AvaTax as a source for Ingestr assets, and you can use it to ingest companies, transactions, nexus, tax codes, and items into your data platform.

Configuration ​

Step 1: Add a connection to the .bruin.yml file ​

yaml
connections:
    avalara:
        - name: "avalara"
          account_id: "1100012345"
          license_key: "your_license_key"
          environment: "production"
          history_start: "2020-01-01"
  • account_id (required): Your AvaTax account ID.
  • license_key (required): The license key for that account. An account administrator generates it in the AvaTax portal under Settings > License and API keys. Generating a new key invalidates the previous one.
  • 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.
  • base_url (optional): Overrides the AvaTax API base URL, e.g. for a proxy. Takes precedence over environment.

Step 2: Create an asset file for data ingestion ​

Create a YAML file (e.g. avalara_ingestion.yml) inside the assets folder:

yaml
name: public.avalara_transactions
type: ingestr

parameters:
  source_connection: avalara
  source_table: 'transactions'

  destination: postgres
  • name: The name of the asset.
  • type: Set to ingestr.
  • source_connection: The name of the Avalara connection defined in .bruin.yml.
  • source_table: One of the tables below.
  • destination: The destination platform/type, for example postgres.

Step 3: Run asset to ingest data ​

bash
bruin run assets/avalara_ingestion.yml

Available Source Tables ​

TablePrimary KeyIncremental KeyIncremental StrategyDetails
companiesid-replaceThe companies in the account
transactionsidmodifiedDatemergeTransactions for every company; lines and summary are JSON columns
nexusid-replaceNexus declarations for every company
tax_codesid-replaceCustom tax codes; Avalara's built-in system tax codes are not included
itemsid-replaceThe item catalog for every company

Incremental behavior and limitations ​

  • transactions selects transactions by modifiedDate within the interval. Without an interval, 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.