Response

GetPostalCodes returns the postal codes for a specified city. Each postal code is returned in a separate record along with the data listed in the following table.

Table 1. GetPostalCodes Output

Response Element

Description

City.Type

The USPS® city type (U.S. addresses only). The city type is determined by looking at the ZIP Code and the city name. For example, the city Lanham MD has the postal codes 20703, 20706, and 20784. Lanham is the primary city in 20703 and 20706 but is a vanity city in 20784.

This field column is only populated if OutputCityType=Y. The possible values are:

V
Vanity (non-mailing) city name.
P
Primary. The city name is the primary mailing city name.
S
Secondary. The city name is an alternate city name but is acceptable. A city can have multiple secondary city names.

PostalCode

A postal code in the specified city.

ProcessedBy

Because this service only works for U.S. addresses, ProcessedBy will always contain one value: USA.

Status

Reports the success or failure of the match attempt.

null
Success
F
Failure

Status.Code

Reason for failure, if there is one. One of the following:

  • CountryNotSupported
  • UnableToLookup

Status.Description

Description of failure.

  • Input country is not supported
  • Input city was blank
  • Input city & state / province was blank, or no match found
  • City-state mismatch (different spelling found, or city-state was a vanity name and vanity matching was not allowed, or city-state did not match ZIP Code)