> ## Documentation Index
> Fetch the complete documentation index at: https://developer.zamp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Addresses

> Validate addresses before collecting taxes to ensure calculations are based on precise location data.

<Note>
  Only US addresses are currently supported.
</Note>

## Validate an Address

### Request

```text theme={null}
POST /addresses
```

<ParamField body="line1" type="string" required>
  Street address
</ParamField>

<ParamField body="line2" type="string">
  Additional address line
</ParamField>

<ParamField body="city" type="string" required>
  City name
</ParamField>

<ParamField body="state" type="string" required>
  2-letter state code
</ParamField>

<ParamField body="zip" type="string" required>
  ZIP code. Format: `#####` or `#####-####`
</ParamField>

<ParamField body="country" default="US" type="string">
  Country code
</ParamField>

<RequestExample>
  ```json POST /addresses theme={null}
  curl -X POST https://api.zamp.com/addresses \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{
      "line1": "120 SW 10TH AVE",
      "line2": null,
      "city": "TOPEKA",
      "state": "KS",
      "zip": "66612"
    }'
  ```
</RequestExample>

### Response

A lookup is considered successful (status code `200`) when the request meets requirements and there are no system failures. If the address is valid, `validatedAddress` is populated with the validated address and coordinates. **An address is invalid (not found) when `validatedAddress` is `null`.**

<ParamField path="originalAddress" body="address">
  The original address passed in the request
</ParamField>

<ParamField path="validatedAddress" body="address">
  Returns the validated address, or `null`
</ParamField>

<ResponseExample>
  ```json Valid Address theme={null}
  {
    "originalAddress": {
      "line1": "120 SW 10TH AVE",
      "line2": null,
      "city": "TOPEKA",
      "state": "KS",
      "zip": "66612",
      "country": "US"
    },
    "validatedAddress": {
      "coordinates": [-95.67659, 39.046513],
      "line1": "120 SW 10th Ave",
      "line2": null,
      "city": "Topeka",
      "state": "KS",
      "zip": "66612-1226",
      "country": "US"
    }
  }
  ```

  ```json Invalid Address theme={null}
  {
    "originalAddress": {
      "line1": "999 NOWHERE RD",
      "line2": null,
      "city": "TOPEKA",
      "state": "KS",
      "zip": "66612",
      "country": "US"
    },
    "validatedAddress": null
  }
  ```
</ResponseExample>

When the address cannot be matched, the request still returns `200` with `validatedAddress` set to `null`:

```json theme={null}
"validatedAddress": null
```
