# GetPCode

Get PCode(s) (Permanent Codes) associated with a location - Country/State/County/City/Zip/NpaNxx/Fips.

`POST /api/v2/afc/pCode`

**API:** AFC SaaS Pro REST v2
**Tag:** Jurisdiction Determination
**API Version:** v2
**Authentication:** Basic (username + license key) or Bearer token

Source: https://developer.avalara.com/products/communications/api/v2/methods/Jurisdiction%20Determination/GetPCode/

## Description

Requests supports using best match or exact match as well as limiting the number of matches returned.
Use a * on the end of Fips/Npanxx Codes to find a range of values.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `client_id` | integer | header | Yes | The client id. |

## Request Body

**Content-Type:** `application/json-patch+json`
**Schema:** `PCodeLookupRequest`

Location data used as input for searching jurisdiction matches.

| Property | Type | Required | Description |
|---|---|---|---|
| `CountryIso` | string | No | 3-character country ISO code. |
| `State` | string | No | 2-character state abbreviation. |
| `County` | string | No | County name. |
| `City` | string | No | City name. |
| `ZipCode` | string | No | 5-digit zip code (full zip code for Canadian addresses). |
| `BestMatch` | boolean | No | Flag indicating whether to return the best matches (true) or exact matches only (false). |
| `LimitResults` | integer | No | Maximum number of results to return. |
| `NpaNxx` | string | No | The related NpaNxx code. |
| `Fips` | string | No | The related Fips code which is 5 digits. |

**Content-Type:** `application/json`
**Schema:** `PCodeLookupRequest`

Location data used as input for searching jurisdiction matches.

| Property | Type | Required | Description |
|---|---|---|---|
| `CountryIso` | string | No | 3-character country ISO code. |
| `State` | string | No | 2-character state abbreviation. |
| `County` | string | No | County name. |
| `City` | string | No | City name. |
| `ZipCode` | string | No | 5-digit zip code (full zip code for Canadian addresses). |
| `BestMatch` | boolean | No | Flag indicating whether to return the best matches (true) or exact matches only (false). |
| `LimitResults` | integer | No | Maximum number of results to return. |
| `NpaNxx` | string | No | The related NpaNxx code. |
| `Fips` | string | No | The related Fips code which is 5 digits. |

**Content-Type:** `text/json`
**Schema:** `PCodeLookupRequest`

Location data used as input for searching jurisdiction matches.

| Property | Type | Required | Description |
|---|---|---|---|
| `CountryIso` | string | No | 3-character country ISO code. |
| `State` | string | No | 2-character state abbreviation. |
| `County` | string | No | County name. |
| `City` | string | No | City name. |
| `ZipCode` | string | No | 5-digit zip code (full zip code for Canadian addresses). |
| `BestMatch` | boolean | No | Flag indicating whether to return the best matches (true) or exact matches only (false). |
| `LimitResults` | integer | No | Maximum number of results to return. |
| `NpaNxx` | string | No | The related NpaNxx code. |
| `Fips` | string | No | The related Fips code which is 5 digits. |

**Content-Type:** `application/*+json`
**Schema:** `PCodeLookupRequest`

Location data used as input for searching jurisdiction matches.

| Property | Type | Required | Description |
|---|---|---|---|
| `CountryIso` | string | No | 3-character country ISO code. |
| `State` | string | No | 2-character state abbreviation. |
| `County` | string | No | County name. |
| `City` | string | No | City name. |
| `ZipCode` | string | No | 5-digit zip code (full zip code for Canadian addresses). |
| `BestMatch` | boolean | No | Flag indicating whether to return the best matches (true) or exact matches only (false). |
| `LimitResults` | integer | No | Maximum number of results to return. |
| `NpaNxx` | string | No | The related NpaNxx code. |
| `Fips` | string | No | The related Fips code which is 5 digits. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | OK | `PCodeLookupResult` |

### 200 Response: `PCodeLookupResult`

Jurisdiction information returned when searching location matches.

| Property | Type | Required | Description |
|---|---|---|---|
| `LocationData` | LocationItem[] | No | List of location matches for the address being searched. |
| `MatchCount` | integer | No | Number of matches returned. |
| `InputMatchType` | string | No | Match type from user input. "Exact" match or "Best" match. |
| `MatchTypeApplied` | string | No | Indicates whether the matches returned are based on an "Exact" match or "Best" match. |
| `ResultsLimit` | integer | No | Maximum number of results applied to search. |