oscar-team/avatax-laravel

A Laravel package for Avalara AvaTax SDK integration
3,882
Install
composer require oscar-team/avatax-laravel
Latest Version:v1.5
PHP:>=7.3
License:MIT
Last Updated:Feb 16, 2026
Links: GitHub  ·  Packagist
Maintainer: moiz2050

Laravel AvaTax Integration

This package provides an integration with Avalara's AvaTax API for Laravel applications. It includes services for handling transactions, tax codes, tax rules, and more.

Installation

Step 1: Install the Package

You can install the package via Composer:

composer require oscar-team/avatax-laravel

Step 2: Publish the Configuration

Publish the package configuration using the following Artisan command:

php artisan vendor:publish --provider="OscarTeam\AvaTax\AvaTaxServiceProvider"

Step 3: Configure AvaTax

Add your Avalara credentials to the .env file:

AVATAX_APP_NAME=demo
AVATAX_APP_VERSION=1
AVATAX_MACHINE_NAME=localhost
AVATAX_ACCOUNT_ID=your_account_id
AVATAX_LICENSE_KEY=your_license_key
AVATAX_ENVIRONMENT=sandbox # or production

Usage

Example 1: Creating a Simple Transaction

use OscarTeam\AvaTax\Facades\AvaTax;
use Avalara\DocumentType;

// Create a new transaction
$transaction = AvaTax::createTransaction([
    'companyCode' => 'DEFAULT',
    'type' => DocumentType::C_SALESINVOICE,
    'customerCode' => 'ABC',
    'addresses' => [
        'SingleLocation' => [
            'line1' => '123 Main Street',
            'city' => 'Irvine',
            'region' => 'CA',
            'postalCode' => '92615',
            'country' => 'US'
        ]
    ],
    'lines' => [
        [
            'amount' => 100.0,
            'quantity' => 1,
            'itemCode' => 'P0000000'
        ]
    ]
]);

echo '<pre>' . json_encode($transaction, JSON_PRETTY_PRINT) . '</pre>';

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v1.5 >=7.3 ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v1.4 >=7.3 ^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.3 >=7.3 ^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.2 >=7.3 ^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v1.1 >=7.3 ^7.0|^8.0|^9.0|^10.0|^11.0 MIT