AvaTax calculates accurate US sales tax and international VAT and can prepare and remit tax returns, file reports, manage VAT registrations and other tax documents.
AvaTax Vendure Plugin
Overview
A plugin that interfaces your Vendure store with Avalara’s AvaTax platform for automated US sales tax calculation based on geolocation, item taxability, new legislation, tax regulations, and more.
This is a paid plugin. For production use, please purchase a license at https://vendure.io/marketplace.
Installation
yarn add @vendure-hub/apagoinc-avatax-plugin
Add all other dependencies required to compile the plugin’s UI
yarn add -D @vendure/ui-devkit react @types/react
Usage
- Add the AvataxPlugin to your
VendureConfig
plugins array.
import { AvataxPlugin } from "@vendure-hub/apagoinc-avatax-plugin"
export const config: VendureConfig = {
// ...
plugins: [
// ...
AvataxPlugin.init({
licenseKey: "your-license-key"
})
]
}
-
Use the Vendure CLI to generate a database migration by running
npx vendure migrate
-
Add the plugin’s UI extensions to the
AdminUiPlugin
options in yourVendureConfig
.
import { compileUiExtensions } from "@vendure/ui-devkit/compiler"
export const config: VendureConfig = {
// ...
plugins: [
// ...
AdminUiPlugin.init({
//
app: compileUiExtensions({
outputPath: path.join(__dirname, "admin-ui"),
extensions: [AvataxPlugin.ui]
})
})
]
}
Read more about the Admin Ui extension and compilation from the Vendure docs.
- The plugin’s UI extensions are built using React and JSX. For the Admin UI to compile, add the
jsx
property to thecompilerOptions
intsconfig.json
file.
{
"compilerOptions": {
"jsx": "react"
}
}
-
Start the server and navigate to
Settings > Avatax
. Here you can configure the plugin with your Avalara credentials. -
Click
Test Connection
to validate your credentials and test the connection to the AvaTax API, thenSave Credentials
to persist them.
Features
- Admin UI extension with widgets to configure Avalara credentials, plugin preferences, company profiles and validate addresses.
- A custom TaxLineCalculationStrategy that fetches tax rates from the AvaTax API.
- Automated AvaTax transaction commits when orders transtion to the
PaymentSettled
state. - A custom permission definition for plugin configuration access control.
- A
verifyAddress
mutation to verify addresses through the AvaTax API
Custom Fields
The plugins adds custom fields to the following entities;
Customer
entityUseCode
: Customer Avalara Entity Use Code
ProductVariant
taxCode
: Product Avalara Tax Code
Order
avataxInvoiceMessages
: Invoice messaging returned by the AvaTax engine stored as a JSON string. These messages can be queried and displayed appropriately on invoices. Read More
Reference
Create your first commerce experience with Vendure in less than 2 minutes
Vendure is a registered trademark. Our trademark policy ensures that our brand and products are protected. Feel free to reach out if you have any questions about our trademarks.
Documentation
Newsletter
Get the latest product news and announcements delivered directly to your inbox.