How to configuring Sales Tax API

How to configuring Sales Tax API

01 Apr 2021
How to configuring Sales Tax API

The TaxJar is used for calculating accurate sales tax. We will use it on the interstate and intrastate levels. We will add multiple states with different sale tax rates. This sales tax is showing at the time of checkout or creating a transaction when an order is created. The accurate calculations of sales tax are done by TaxJar API. Also we have to generate a report and determine how much sales tax is collected. The spree framework is specially used for making E-commerce sites. Most of the functionality is already made in it and some of the functionality is worked on the specific rails version. Using this framework we can make a full-featured E-commerce site in less time. It's the best framework to create an E-commerce site.

The framework provides features like-

  • Tax reports.
  • Simplified sales tax.
  • Street-level rooftop calculations.
  • Multiple nexus addresses per merchant.
  • Line item taxability and itemized discounts.
  • Sourcing logic for interstate and intrastate orders and shipments.


  • Ruby on rails
  • Spree framework 


  • To find the API key of TaxJar sales tax 
  • To configure TaxJar in spree app


  1. Add the mentioned extension- gem 'spree_taxjar', github: 'vinsol-spree-contrib/spree_taxjar'  - to your Gemfile.
  2. Install the gem using Bundler: bundle install.
  3. Copy & run migrations: bundle exec rails g spree_taxjar:install 
  4. Run rails assets: precompile. 
  5. Restart your server: 
    • Create a new account with TaxJar. (
    • Go to Account >> SmartCalcs API to create the API token. This API token is required to estimate the sales tax from TaxJar over API.
    • Go to Account >> State Settings and click on the Add State with Nexus button to add each state where you need/require to collect the sales tax.   
  6. Go to Admin >> Configurations >> TaxJar Settings:
    • Add the TaxJar API Token.
    • Check the TAXJAR ENABLED checkbox.
    • Check the TAXJAR DEBUG ENABLED for debugging issues.  
    • Update the tax rates to Spree/TaxJar calculator.

Leave a comment: