# TaxRatesByPostalCode

Sales tax rates for a specified country and postal code. This API is only available for US postal codes.

`GET /api/v2/taxrates/bypostalcode`

**API:** AvaTax API
**Tag:** TaxContent
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/TaxContent/TaxRatesByPostalCode/

## Description

This API is only available for a US postal codes.
            
Usage of this API is subject to rate limits.  Users who exceed the rate limit will receive HTTP
response code 429 - `Too Many Requests`.
            
This API assumes that you are selling general tangible personal property at a retail point-of-sale
location in the United States only.
            
Please be advised that this endpoint is designed for approximate tax rate estimation only and
may not yield precise results. For a more powerful and accurate tax estimation, upgrade to the
`CreateTransaction` API, which offers a variety of advanced features including, but not limited
to:
            
* Nexus declarations
* Taxability based on product/service type
* Sourcing rules affecting origin/destination states
* Customers who are exempt from certain taxes
* States that have dollar value thresholds for tax amounts
* Refunds for products purchased on a different date
* Detailed jurisdiction names and state assigned codes
* And more!
            
Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/)
for information on how to upgrade to the full AvaTax CreateTransaction API.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `country` | string | query | Yes | Name or ISO 3166 code identifying the country.
            
This field supports many different country identifiers:
 * Two character ISO 3166 codes
 * Three character ISO 3166 codes
 * Fully spelled out names of the country in ISO supported languages
 * Common alternative spellings for many countries
            
For a full list of all supported codes and names, please see the Definitions API `ListCountries`. |
| `postalCode` | string | query | Yes | The postal code of the location. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `TaxRateModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |

### 200 Response: `TaxRateModel`

Contains information about the general tangible personal property sales tax rates for this jurisdiction.
            
This rate is calculated by making assumptions about the tax calculation process.  It does not account for:
            
* Sourcing rules, such as origin-and-destination based transactions.
* Product taxability rules, such as different tax rates for different product types.
* Nexus declarations, where some customers are not obligated to collect tax in specific jurisdictions.
* Tax thresholds and rate differences by amounts.
* And many more custom use cases.
            
To upgrade to a fully-featured and accurate tax process that handles these scenarios correctly, please
contact Avalara to upgrade to AvaTax!

| Property | Type | Required | Description |
|---|---|---|---|
| `totalRate` | number | No | The total sales tax rate for general tangible personal property sold at a retail point of presence
in this jurisdiction on this date. Example: `0.095`. |
| `rates` | RateModel[] | No | The list of individual rate elements for general tangible personal property sold at a retail
point of presence in this jurisdiction on this date. |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/taxrates/bypostalcode" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```