# Validate and resolve addresses for sales tax calculation

Source: https://developer.avalara.com/address-validation/gkn8134761458925/

# Validate and resolve addresses for sales tax calculation

Explicit address validations are standalone address validation calls to the [ResolveAddressPost](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Addresses/ResolveAddressPost/) API. This API provides address resolution only and doesn't calculate taxes.

It returns a success response if it was able to identify the address and provide information. Otherwise, the API responds with an error code.

A typical address validation call might provide some incomplete information about an address.

In the request example below, the API identifies a street by a partial name and provides no postal code.

**View example**

```
curl
  -X POST 'https://sandbox-rest.avatax.com/api/v2/addresses/resolve'
  -H 'Accept: application/json'
  -H 'Authorization: Basic ${btoa(`:`)}'
  -H 'Content-Type: application/json'
  --data '{
     "textCase": "Upper",
     "line1": "2000 main",
     "city": "Irvine",
     "region": "CA",
     "country": "US"
  }'
```

The API call's response indicates that AvaTax was able to locate the address and identify it correctly as “2000 MAIN ST” in postal code 92614-7211.

The partial response below shows how the API identified the validated address as an intersection and determined the latitude and longitude successfully.

```
{
  "address": {
    "textCase": "Upper",
    "line1": "2000 main",
    "city": "Irvine",
    "region": "CA",
    "country": "US"
  },
  "validatedAddresses": [
    {
      "addressType": "HighRiseOrBusinessComplex",
      "line1": "2000 MAIN ST",
      "line2": "",
      "line3": "",
      "city": "IRVINE",
      "region": "CA",
      "country": "US",
      "postalCode": "92614-7211",
      "latitude": 33.684764,
      "longitude": -117.851645
    }
  ],
  "coordinates": {
    "latitude": 33.684764,
    "longitude": -117.851645
  },
  "resolutionQuality": "Intersection",
  "taxAuthorities": [
    {
      "avalaraId": "5000531",
      "jurisdictionName": "CALIFORNIA",
      "jurisdictionType": "State",
      "signatureCode": "AGAM"
    }
  ]
}
```

When you provide invalid information to the address resolution API, you’ll receive an error message indicating how the data was incomplete.

Here’s a request example of an identified but undeliverable address:

```
curl
    -X POST 'https://sandbox-rest.avatax.com/api/v2/addresses/resolve'
    -H 'Accept: application/json'
    -H 'Authorization: Basic ${btoa(`:`)}'
    -H 'Content-Type: application/json'
    --data '{
       "textCase": "Upper",
       "line1": "123 Main Street",
       "city": "Irvine",
       "region": "CA",
       "country": "US",
       "postalCode": "92615"
    }'
```

In the response body, you’ll receive a list of `messages` with additional information about the address resolution problem.

```
{
  "messages": [
    {
      "summary": "The address is not deliverable.",
      "details": "The physical location exists but there are no homes on this street. One reason might be railroad tracks or rivers running alongside this street, as they would prevent construction of homes in this location.",
      "refersTo": "Address",
      "severity": "Error",
      "source": "Avalara.AvaTax.Common"
    }
  ]
}
```

Address validation is a difficult process. It isn’t always possible to identify the address a customer means when they provide partial information.

The USPS provides guidance to developers like Avalara, and we update our address resolution system each month with the best available information.

Some common problems that customers experience are:

-   **New construction:** It can take between 1 and 6 months for newly constructed houses and buildings to appear in online databases.

-   **Imprecise geocoding:** Although our database provides latitude and longitude values for addresses, we can’t guarantee a specific level of precision for all addresses. Check the `resolutionQuality` value to determine the level of detail in your data.

-   **Incomplete data:** In the U.S., you obtain the best results when you know the street address and either the ZIP Code or city and state. If you don't have enough information, AvaTax will try its best to provide whatever information can be determined.

An example of partial address resolution is that, when you provide the following address to the [ResolveAddressPost](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Addresses/ResolveAddressPost/) API:

900 winslow way, bainbridge island, 98110

AvaTax will identify this address, validate it, and provide the following detailed result:

```
{
  "validatedAddresses": [
    {
      "addressType": "HighRiseOrBusinessComplex",
      "line1": "900 WINSLOW WAY E",
      "line2": "",
      "line3": "",
      "city": "BAINBRIDGE ISLAND",
      "region": "WA",
      "country": "US",
      "postalCode": "98110-2450",
      "latitude": 47.624937,
      "longitude": -122.510324
    }
  ]
}
```