This is a Ruby client library for the AvaTax REST API methods: tax/get POST, tax/get GET, tax/cancel POST, and address/validate GET.
For more information on the use of these methods and the AvaTax product, please visit our developer site or homepage
- Ruby 1.9.2 or later
- Bundler
- Add the
avatax
gem to your Gemfile withgem 'avatax'
- Run
bundle install
to retrieveavatax
and all its dependencies - Authentication requires an valid Account Number and License Key. If you do not have an AvaTax account, a free trial account can be acquired through our developer site
- Specify your authentication credentials as
- environment variables,
- YAML file (see
credentials.yml.example
), or - in source
$ AVATAX_ACCOUNT_NUMBER=1234567890 AVATAX_LICENSE_KEY=A1B2C3D4E5F6G7H8 AVATAX_SERVICE_URL=https://development.avalara.net bundle exec ruby examples/PingTest.rb
AvaTax.configure_from 'credentials.yml.example'
AvaTax.configure do
account_number '1234567890'
license_key 'A1B2C3D4E5F6G7H8'
service_url 'https://development.avalara.net'
end
Filename | Description |
---|---|
CancelTaxTest.rb | Demonstrates AvaTax::TaxService.cancel used to void a document |
EstimateTaxTest.rb | Demonstrates the AvaTax::TaxService.estimate method used for product- and line- indifferent tax estimates. |
GetTaxTest.rb | Demonstrates the AvaTax::TaxService.get method used for product- and line- specific calculation. NOTE: This will generate a new transaction/document each time. |
PingTest.rb | Uses a hardcoded AvaTax::TaxService.estimate call to test connectivity and credential information. |
ValidateTest.rb | Demonstrates the AvaTax::AddressService.validate method to normalize an address. |