Skip to content

Instantly share code, notes, and snippets.

@cjstage
Forked from lakshmantgld/salesTax.md
Created April 2, 2021 20:40
Show Gist options
  • Save cjstage/c728fd6e2bc45d8577f42c0fb47d6d45 to your computer and use it in GitHub Desktop.
Save cjstage/c728fd6e2bc45d8577f42c0fb47d6d45 to your computer and use it in GitHub Desktop.

Revisions

  1. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions salesTax.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,8 @@ There are many companies [providing sales tax API](https://www.programmableweb.c
    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this link [create free account](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:


    ![Avalara e-mail](http://i.imgur.com/zXWfCJ9.png)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value should be **base64Encoded** value of **accountId:licenseKey**. The **accountId** and **licenseKey** can be obtained from the mail that you received from avalara.
  2. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions salesTax.md
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,10 @@

    There are many companies [providing sales tax API](https://www.programmableweb.com/news/avalara-releases-free-tax-rates-api/2015/01/13). Out of all the companies, [Avalara](https://www.avalara.com/) offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this link ![create free account](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).
    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this link [create free account](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    [Avalara e-mail](http://i.imgur.com/zXWfCJ9.png)
    ![Avalara e-mail](http://i.imgur.com/zXWfCJ9.png)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value should be **base64Encoded** value of **accountId:licenseKey**. The **accountId** and **licenseKey** can be obtained from the mail that you received from avalara.

  3. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    There are many companies [providing sales tax API](https://www.programmableweb.com/news/avalara-releases-free-tax-rates-api/2015/01/13). Out of all the companies, [Avalara](https://www.avalara.com/) offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this ![link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).
    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this link ![create free account](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    [Avalara e-mail](http://i.imgur.com/zXWfCJ9.png)
  4. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. No changes.
  5. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ The Free-To-Use API by avalara has some restrictions. Usage of this API is subje
    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    [Avalara e-mail](http://i.imgur.com/zXWfCJ9.png)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value is the **base64Encoded** value of **accountId:licenseKey**. These can be obtained from the mail.
    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value should be **base64Encoded** value of **accountId:licenseKey**. The **accountId** and **licenseKey** can be obtained from the mail that you received from avalara.

    Here is Axios example of `TaxRatesByPostalCode`:

  6. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ There are many companies [providing sales tax API](https://www.programmableweb.c
    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this ![link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    [Imgur](http://i.imgur.com/zXWfCJ9.png)
    [Avalara e-mail](http://i.imgur.com/zXWfCJ9.png)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value is the **base64Encoded** value of **accountId:licenseKey**. These can be obtained from the mail.

  7. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    There are many companies [providing sales tax API](https://www.programmableweb.com/news/avalara-releases-free-tax-rates-api/2015/01/13). Out of all the companies, [Avalara](https://www.avalara.com/) offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this [link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).
    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this ![link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    [Imgur](http://i.imgur.com/zXWfCJ9.png)
  8. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ There are many companies [providing sales tax API](https://www.programmableweb.c
    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this [link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    ![Avalara e-mail](http://imgur.com/a/biMBl)
    [Imgur](http://i.imgur.com/zXWfCJ9.png)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value is the **base64Encoded** value of **accountId:licenseKey**. These can be obtained from the mail.

  9. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ There are many companies [providing sales tax API](https://www.programmableweb.c

    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this [link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the form from above link, you will get an e-mail conatining temporary credentials to login the avalara account. The e-mail will look something like this:
    Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:
    ![Avalara e-mail](http://imgur.com/a/biMBl)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value is the **base64Encoded** value of **accountId:licenseKey**. These can be obtained from the mail.
  10. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ There are many companies [providing sales tax API](https://www.programmableweb.c

    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this [link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the above form, you will get an e-mail conatining temporary credentials to login the avalara account. The e-mail will look something like this:
    Once you have filled the form from above link, you will get an e-mail conatining temporary credentials to login the avalara account. The e-mail will look something like this:
    ![Avalara e-mail](http://imgur.com/a/biMBl)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value is the **base64Encoded** value of **accountId:licenseKey**. These can be obtained from the mail.
  11. @lakshmantgld lakshmantgld revised this gist Aug 10, 2017. 1 changed file with 52 additions and 1 deletion.
    53 changes: 52 additions & 1 deletion salesTax.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,52 @@
    **dsfsdf**
    ## Sales Tax API

    There are many companies [providing sales tax API](https://www.programmableweb.com/news/avalara-releases-free-tax-rates-api/2015/01/13). Out of all the companies, [Avalara](https://www.avalara.com/) offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

    The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code `429 - Too Many Requests`. The requirement for this API is to create an avalara free trail account. You can create a free account using this [link](https://developer.avalara.com/blog/2017/03/02/avatax-free-trial/).

    Once you have filled the above form, you will get an e-mail conatining temporary credentials to login the avalara account. The e-mail will look something like this:
    ![Avalara e-mail](http://imgur.com/a/biMBl)

    Now, lets look into the salesTaxAPI. The API is called `TaxRatesByPostalCode`. It needs an `Authoriaztion` header. For free account, the authorization value is the **base64Encoded** value of **accountId:licenseKey**. These can be obtained from the mail.

    Here is Axios example of `TaxRatesByPostalCode`:

    ```js
    var axios = require('axios');

    axios({
    method:'get',
    url:'https://sandbox-rest.avatax.com/api/v2/taxrates/bypostalcode?country=<COUNTRY>&postalCode=<POSTAL-CODE>',
    headers: {'Authorization': 'Basic ' + <Base64Encoded(ACCOUNT-ID + ':' + LICENSE-KEY)>}
    })
    .then(function (response) {
    console.log(response.data);
    })
    .catch(function (error) {
    console.log(error.response.data);
    });
    ```
    Fill the above required values like **COUNTRY**, **POSTAL-CODE**, **Base64Encoded(ACCOUNT-ID + ':' + LICENSE-KEY)**. Assuming the Country as `US` and postalCode as `98101`. The response will look like this:

    ```js
    {
    "totalRate": 0.101,
    "rates": [
    {
    "rate": 0.065,
    "name": "WA STATE TAX",
    "type": "State"
    },
    {
    "rate": 0,
    "name": "WA COUNTY TAX",
    "type": "County"
    },
    {
    "rate": 0.036,
    "name": "WA CITY TAX",
    "type": "City"
    }
    ]
    }
    ```
  12. @lakshmantgld lakshmantgld created this gist Aug 10, 2017.
    1 change: 1 addition & 0 deletions salesTax.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    **dsfsdf**