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) orsandbox. Usesandboxfor an account created on the AvaTax sandbox.history_start(optional): The earliest transaction date to read, asYYYY-MM-DD. Defaults to2000-01-01.base_url(optional): Overrides the AvaTax API base URL, e.g. for a proxy. Takes precedence overenvironment.
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: postgresname: The name of the asset.type: Set toingestr.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 examplepostgres.
Step 3: Run asset to ingest data
bash
bruin run assets/avalara_ingestion.ymlAvailable Source Tables
| Table | Primary Key | Incremental Key | Incremental Strategy | Details |
|---|---|---|---|---|
companies | id | - | replace | The companies in the account |
transactions | id | modifiedDate | merge | Transactions for every company; lines and summary are JSON columns |
nexus | id | - | replace | Nexus declarations for every company |
tax_codes | id | - | replace | Custom tax codes; Avalara's built-in system tax codes are not included |
items | id | - | replace | The item catalog for every company |
Incremental behavior and limitations
transactionsselects transactions bymodifiedDatewithin the interval. Without an interval, every transaction dated on or afterhistory_startis read.- Voided, adjusted, and uncommitted documents are kept along with their
status, so filter onstatus(for exampleCommitted) when you only want reportable documents.