All Projects → avadev → AvaTax-REST-V2-PHP-SDK

avadev / AvaTax-REST-V2-PHP-SDK

Licence: Apache-2.0 License
Sales Tax API SDK for PHP and AvaTax REST

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to AvaTax-REST-V2-PHP-SDK

AvaTax-REST-V2-Ruby-SDK
Sales Tax API SDK for Ruby and AvaTax REST
Stars: ✭ 34 (-19.05%)
Mutual labels:  tax-rate, sales-tax, tax-rates, avalara
taxjar.net
Sales Tax API Client for .NET / C#
Stars: ✭ 21 (-50%)
Mutual labels:  ecommerce, tax-rate, sales-tax
taxjar-woocommerce-plugin
WooCommerce Sales Tax Plugin by TaxJar
Stars: ✭ 26 (-38.1%)
Mutual labels:  ecommerce, tax-rate, sales-tax
taxjar-magento2-extension
Magento 2 Sales Tax Extension by TaxJar
Stars: ✭ 23 (-45.24%)
Mutual labels:  ecommerce, tax-rate, sales-tax
taxjar-php
Sales Tax API Client for PHP 5.5+
Stars: ✭ 66 (+57.14%)
Mutual labels:  ecommerce, tax-rate, sales-tax
canada-sale-tax-api
API to retrieve canadian federal and provincial tax rates. Documentation and endpoints on the website:
Stars: ✭ 18 (-57.14%)
Mutual labels:  tax-rate, tax-rates
AvaTax-REST-V2-Python-SDK
Sales Tax API SDK for Python and AvaTax REST
Stars: ✭ 17 (-59.52%)
Mutual labels:  avatax, avalara
taxjar-python
Sales Tax API Client for Python 2.6+ / Python 3+
Stars: ✭ 24 (-42.86%)
Mutual labels:  ecommerce, sales-tax
taxjar-java
Sales Tax API Client for Java
Stars: ✭ 13 (-69.05%)
Mutual labels:  ecommerce, sales-tax
SyliusVendorPlugin
This is a Sylius Plugin that add vendors (brands) to your store. The vendors is an entity that sells products and are fully customizable by the admin.
Stars: ✭ 51 (+21.43%)
Mutual labels:  ecommerce
blog
MageVision Blog
Stars: ✭ 23 (-45.24%)
Mutual labels:  ecommerce
magento2
Vue Storefront 2 integration for Magento 2
Stars: ✭ 94 (+123.81%)
Mutual labels:  ecommerce
awrora-starter
Landing page template built with one of most popular javascript library Vue.JS, Vuetify (Material Design) and Nuxt.JS with SSR.
Stars: ✭ 38 (-9.52%)
Mutual labels:  ecommerce
next-ecommerce
A beautiful ecommerce made with Next.js
Stars: ✭ 184 (+338.1%)
Mutual labels:  ecommerce
django-ecommerce-project
The Django-Ecommerce is an open-source project initiative and tutorial series built with Python and the Django Framework.
Stars: ✭ 182 (+333.33%)
Mutual labels:  ecommerce
awesome-ecommerce
Collect and develop Open Source or Free Projects for building ecommerce platform easy and fast and free
Stars: ✭ 39 (-7.14%)
Mutual labels:  ecommerce
boxshop
Laravel ecommerce platform
Stars: ✭ 78 (+85.71%)
Mutual labels:  ecommerce
SyliusReportPlugin
Report Plugin for Sylius. This plugin add a report interface to the Sylius administration. Some reports comes with this bundle but you can create your custom reports.
Stars: ✭ 25 (-40.48%)
Mutual labels:  ecommerce
django ecommerce
Scalable Django E-Commerce, perfect to start one new online shop project.
Stars: ✭ 25 (-40.48%)
Mutual labels:  ecommerce
app-search-magento
A first party module to integrate Elastic App Search in Magento 2.
Stars: ✭ 25 (-40.48%)
Mutual labels:  ecommerce

AvaTax-REST-V2-PHP-SDK

This GitHub repository is the PHP SDK for Avalara's world-class tax service, AvaTax. It uses the AvaTax REST v2 API, which is a fully REST implementation and provides a single client for all AvaTax functionality. For more information about AvaTax REST v2, please visit Avalara's Developer Network or view the online Swagger documentation.

Build Status

Packagist

Packagist

Travis-CI

Travis

Installing the PHP SDK

The AvaTax PHP SDK is available as a Composer package.

To use the AvaTax PHP SDK from Composer:

  • Add a composer.json file to your project and link to AvaTax:
{
    "require": {
        "avalara/avataxclient": "*"
    }
}
  • Run composer install to download the latest version.

Using the PHP SDK

The PHP SDK uses a fluent interface to define a connection to AvaTax and to make API calls to calculate tax on transactions. Here's an example of connecting to the API.

<?php

// Include the AvaTaxClient library
require __DIR__ . '/vendor/autoload.php';
use Avalara\AvaTaxClient;

// Create a new client
$client = new Avalara\AvaTaxClient('phpTestApp', '1.0', 'localhost', 'sandbox');
$client->withSecurity('myUsername', 'myPassword');

// If I am debugging, I can call 'Ping' to see if I am connected to the server
$p = $client->ping();
echo('<h2>Ping</h2>');
echo('<pre>' . json_encode($p, JSON_PRETTY_PRINT) . '</pre>');
if ($p->authenticated == true) {
    echo '<p>Authenticated!</p>';
}

// Create a simple transaction for $100 using the fluent transaction builder
$tb = new Avalara\TransactionBuilder($client, "DEFAULT", Avalara\DocumentType::C_SALESINVOICE, 'ABC');
$t = $tb->withAddress('SingleLocation', '123 Main Street', null, null, 'Irvine', 'CA', '92615', 'US')
    ->withLine(100.0, 1, null, "P0000000")
    ->create();
echo('<h2>Transaction #1</h2>');
echo('<pre>' . json_encode($t, JSON_PRETTY_PRINT) . '</pre>');

// Now, let's create a more complex transaction!
$tb = new Avalara\TransactionBuilder($client, "DEFAULT", Avalara\DocumentType::C_SALESINVOICE, 'ABC');
$t = $tb->withAddress('ShipFrom', '123 Main Street', null, null, 'Irvine', 'CA', '92615', 'US')
    ->withAddress('ShipTo', '100 Ravine Lane', null, null, 'Bainbridge Island', 'WA', '98110', 'US')
    ->withLine(100.0, 1, null, "P0000000")
    ->withLine(1234.56, 1, null, "P0000000")
    ->withExemptLine(50.0, null, "NT")
    ->withLine(2000.0, 1, null, "P0000000")
    ->withLineAddress(Avalara\TransactionAddressType::C_SHIPFROM, "123 Main Street", null, null, "Irvine", "CA", "92615", "US")
    ->withLineAddress(Avalara\TransactionAddressType::C_SHIPTO, "1500 Broadway", null, null, "New York", "NY", "10019", "US")
    ->withLine(50.0, 1, null, "FR010000")
    ->create();
echo('<h2>Transaction #2</h2>');
echo('<pre>' . json_encode($t, JSON_PRETTY_PRINT) . '</pre>');

?>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].