Validate an Address

HTTP Request

POST /v1/addresses/verify

Summary

Address validation verifies and cleanses postal addresses within the United States to help ensure packages are rated accurately and shipments arrive at their final destinations on time. The Validate Address operation sends an address to be verified. The response indicates whether the address is valid and whether the validation check made changes to the address.

Things to Consider

  1. Only U.S. domestic addresses are validated using this POST operation at this time.

  2. Pitney Bowes verifies addresses for accuracy against current USPS data and makes corrections to delivery lines and last lines when possible. You can optionally limit the extent of corrections by enabling minimal address validation through the minimalAddressValidation query parameter.

    The following table compares complete and minimal address validation:

    Complete Address Validation (Default)
    Minimal Address Validation
    Evaluates entire address against current USPS address information. Evaluates entire address against current USPS address information.
    If current USPS address information indicates no delivery to the address, the API returns an error. If current USPS address information indicates no delivery to the address, the API returns an error.
    If the address cannot be validated against current USPS address information, the API returns an error.

    If the entire address cannot be validated against current USPS address information, the API checks whether just the last line (city/state/postal code) can be validated:

    • If the last line cannot be validated, the API returns an error.

    • If the last line can be validated, the API checks whether the delivery line (street address) has the correct format (e.g., a street number and street name). If it does, the API returns the address with any corrections only to the last line. The API does not verify or change the delivery line. The API returns the delivery line exactly as it is specified in the request. The API also does not provide a ZIP+4 or 2-digit delivery point.

      If you use minimal address validation, ensure the delivery line you enter is actually deliverable.

    If the API determines the address is a match or close match, the API returns the address with any corrections. The API also returns the ZIP+4 and the 2-digit delivery point. If the API determines the address is a match or close match, the API returns the address with any corrections only to the last line. The API also returns the ZIP+4 and the 2-digit delivery point.
  3. The following Address Object fields are required:

    • addressLines
    • postalCode
    • countryCode
  4. If validation fails, you can use the Suggest Addresses API call to provide suggestions that could result in the address passing verification in a subsequent Address Validation API call.

Request URIs

Sandbox: https://api-sandbox.pitneybowes.com/shippingservices/v1/addresses/verify
Production: https://api.pitneybowes.com/shippingservices/v1/addresses/verify

Query Parameter

The query parameter is optional.

Important: The parameter is case-sensitive.

Name Description
minimalAddressValidation

When set to true, the complete address (delivery line and last line) is validated but only the last line (city, state, and postal code) would be changed by the validation check.

Important: If any part of the address, including the delivery line, is marked “Undeliverable” according to USPS data, address validation returns an error.

Valid values:

  • true
  • false

Request Headers

Name
Description
Authorization Required. OAuth token generated using the Generate an OAuth Token API.
Content-Type Required. The media type of the request entity. Set this to application/json.
Accept-Language Language and country code. Default: en-US
X-PB-UnifiedErrorStructure Recommended. Set this to true to use the standard error object if an error occurs.

Request / Response Elements

The API call sends and receives an Address Object. The following table describes all possible fields in an Address Object.

Important

Some fields in the Address Object might not apply to your operation and are marked accordingly.

Name Data Type Description
addressLines Array[String]

Street address or P.O. Box. Include apartment number if applicable. You can specify up to 3 address lines.

Required if specified as such on the API request’s documentation page.

USPS: For USPS domestic destinations, ensure that the street address is specified as the last of the 3 address lines. This way, the street address is printed right above the city, state, postal ZIP code, per USPS label guidelines.

cityTown String

The city or town.

Required if specified as such on the API request’s documentation page.

stateProvince String

The state or province. For a US or Canadian address, use the 2-letter state or province code.

Required if specified as such on the API request’s documentation page.

postalCode String

The postal code or ZIP code.

For US addresses, use either the 5-digit or 9-digit ZIP code in one of the following formats:

  • 12345
  • 12345-6789

If you use a different format, such as 12345- or 123451234, you will receive an error.

Required if specified as such on the API request’s documentation page.

countryCode String

Two-character country code from the ISO country list.

Required if specified as such on the API request’s documentation page.

company String

The name of the company.

Required if specified as such on the API request’s documentation page.

name String

The first and last name.

Required if specified as such on the API request’s documentation page.

phone String

The phone number. Enter the digits with or without spaces or hyphens. When used for Pickups, the maximum is 10 digits.

Required if specified as such on the API request’s documentation page.

email String

The email address.

Required if specified as such on the API request’s documentation page.

residential Boolean Indicates whether this is a residential address. Pitney Bowes recommends including this parameter to improve address verification.
deliveryPoint String The 2-digit USPS domestic delivery point, when available.
carrierRoute String The last four characters of the USPS domestic carrier route code. The carrier route is the area served by a particular USPS mail carrier. The full carrier route code is a nine-character string comprising the five-digit postal code appended by these four characters.
taxId String Pickup Request Only. Tax identification number. This is optional for pickup requests.
status String

RESPONSE ONLY. Indicates whether the address is valid and whether the validation check made changes to the address.

Note: The response does not return this field if minimal address validation is enabled.

Possible values are:

  • VALIDATED_CHANGED: The address is valid. The validation check made changes to the address.
  • VALIDATED_AND_NOT_CHANGED: The address is valid. No changes were made.
  • NOT_CHANGED: The address could not be validated. No changes were made.

Sample Request

curl -X POST .../v1/addresses/verify?minimalAddressValidation=false \
-H "Authorization: Bearer <oauth_token>" \
-H "Content-Type: application/json" \
-H "X-PB-UnifiedErrorStructure: true" \
-d '
{
    "addressLines": [
        "27 Waterview Drive",
        "",
        ""
    ],
    "cityTown": "Shelton",
    "stateProvince": "CT",
    "postalCode": "06484",
    "countryCode": "US",
    "company": "Pitney Bowes Inc.",
    "name": "John Smith",
    "phone": "203-000-0000",
    "email": "john@example.com",
    "residential": false
}'

Sample Response

{
    "addressLines": [
        "27 Waterview Dr"
    ],
    "cityTown": "Shelton",
    "stateProvince": "CT",
    "postalCode": "06484-4361",
    "countryCode": "US",
    "company": "Pitney Bowes Inc.",
    "name": "John Smith",
    "phone": "203-000-0000",
    "email": "john@example.com",
    "residential": false,
    "deliveryPoint": "27",
    "carrierRoute": "C010",
    "status": "VALIDATED_CHANGED"
}

Error Codes

Error codes specific to address validation are seven-digits long and start with 10. See the address-specific errors in 7-Digit Error Codes.

For a list of all PB Shipping APIs error codes, please see Error Codes.