# Avalara License Guidance Teaser API

API for retrieving license counts by jurisdiction based on location and business activities. This API serves as a teaser for the full Avalara License Guidance (ALG) system.

Source: https://developer.avalara.com/products/registration-and-licensing/api/

**Version:** 1.0.0
**Base URL:** https://www.businesslicenses.com/blms/webservice/api

---

## Endpoints

### License Teaser

#### Retrieve license counts by jurisdiction.

`GET /licenses/jurisdiction/totals`

Returns the total number of licenses by jurisdiction for the requested locations and business activities. Use this endpoint to retrieve data for a teaser page.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `key` | string | query | Yes | Secure ID provided by Business Licenses, LLC. |
| `locations[0][state]` | string | query | No | Two character state abbreviation of the location. |
| `locations[0][country]` | string | query | No | Two character country code of the location. |
| `locations[0][address]` | string | query | No | Street address of the location. |
| `locations[0][city]` | string | query | No | City of the location. |
| `locations[0][zip]` | string | query | No | ZIP code of the location. |
| `locations[0][plus4]` | string | query | No | ZIP 4 code of the location. |
| `locations[0][county]` | string | query | No | County of the location. |
| `business_activities[0][business_activity_id]` | string | query | No | Business activity ID provided by Business Licenses, LLC. |
| `keywords[0][keyword_id]` | string | query | No | Keyword ID provided by Business Licenses, LLC. |
| `activities[0][activity_id]` | string | query | No | Industry activity ID provided by Business Licenses, LLC. |
| `answers[0][question]` | string | query | No | Question associated with the answer. |
| `answers[0][answer]` | string | query | No | Answer corresponding to the specified question. |


### Validation

#### Validate a location.

`GET /validation/location`

Validates a location and returns geocoded information if the location is valid. This endpoint can be used before calling the teaser endpoint.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `key` | string | query | Yes | Secure ID provided by Business Licenses, LLC. |
| `location[address]` | string | query | No | Street address of the location. |
| `location[city]` | string | query | No | City of the location. |
| `location[state]` | string | query | No | Two character state abbreviation of the location. |
| `location[zip]` | string | query | No | ZIP code of the location. |
| `location[plus4]` | string | query | No | ZIP4 code of the location. |
| `location[county]` | string | query | No | County of the location. |
| `location[country]` | string | query | Yes | Two character country code of the location. |

#### Validate business activities.

`GET /validation/business_activities`

Retrieves Business Licenses business activities that correspond to the activities used on your website.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `key` | string | query | Yes | Secure ID provided by Business Licenses, LLC. |
| `business_activities[0]` | string | query | Yes | Business activity from the partner business activity list. |

---

## Models

### LicenseCounts

| Property | Type | Description |
|---|---|---|
| `Federal` | integer | Number of federal licenses required. |
| `State` | integer | Number of state licenses required. |
| `County` | integer | Number of county licenses required. |
| `Local` | integer | Number of local licenses required. |

### Error

| Property | Type | Description |
|---|---|---|
| `ReturnCode` | string | Error message. |
| `ErrorCode` | integer | Error code. |
| `ErrorMessage` | string | Detailed error message. |

### LocationValidationResponse

| Property | Type | Description |
|---|---|---|
| `ResultCode` | string | Status message for the validation result. |
| `ErrorCode` | integer | Error code (0 = no error, 1 = invalid, 2 = warning) |
| `ErrorMessage` | string | Error message if an error occurs. |
| `Location` | object | Validated location details. |

### BusinessActivityValidationResponse

| Property | Type | Description |
|---|---|---|
| `ReturnCode` | string | Status message for the request. |
| `BusinessActivities` | array | List of validated business activities. |
