Chapter 4.4.1 - PCode Jurisdiction Determination
/api/v2/afc/PCode Jurisdiction Determination endpoint returns a list of PCodes associated with a specified location.
PCode Jurisdiction Determination
The PCode Jurisdiction Determination endpoint accepts a PCode Lookup Request. Specify a location, best match or exact match, and how many results you want to see. Location data, including PCode, is returned along with additional details in the PCode Lookup Result.
Specify a location.
- Include least one of the location fields:
- Country (
- State (
- County (
- City (
- Postal Code (
- NPANXX Code (
- Fips Code (
- Country defaults to "USA" if not supplied
- Use "*" at the end of
Fipsto get a range of values
The Best Match flag (
BestMatch) indicates the type of results.
true: Best match is returned
- An exact match is attempted first
- Best Match is applied if the exact match search fails
false: Only an exact match is returned
- Check the
MatchTypeAppliedZip Lookup Result field to see which match type is used
Considerations when using the Best Match flag:
- Punctuation in a city names is ignored
- Whitespace in a city name is ignored
- For example, the city name "LAND O' LAKES" is returned as an exact match when "LAND O LAKES" or "LANDOLAKES" are supplied because both punctuation and white space is ignored
The Limit Results field (
LimitResults) is used to limit the number of matches returned in the Zip Lookup Result.
- Default is 100 results - passing
0sets the limit to the default
- Maximum is 1,000 results - passing a value greater than the max sets the limit to the maximum
PCode Jurisdiction Determination Example 1 - Best Match
This example demonstrates a best match PCode Jurisdiction Determination request.
One location (
LocationData) is returned using a best match (
PCode Jurisdiction Determination Example 2 - Zip Code
This example demonstrates a best match request using only a zip code (
Five locations (
LocationData) are returned using an exact match (
PCode Jurisdiction Determination Example 3 - India Best Match
This example demonstrates a PCode lookup in India (
CountryISO is set to “IND”).
The country of India (
CountyISO) is returned even though a local jurisdiction is requested.
PCode Jurisdiction Determination Example 4 - India Exact Match
Similar to Example 3, but with an exact match requested (
BestMatch set to
No results are returned because an exact match for the requested jurisdiction can’t be found.
PCode Jurisdiction Determination Example 5 - NPANXX Range
This example demonstrates both an NPANXX and Fips code range by using a “*”.
Results are limited to 14 jurisdictions:
- 1 jurisdiction returned for Johnson County, KS
- 12 jurisdictions related to the 816 NPANXX range
- 1 jurisdiction returned for the 9901250415 range