Verify US Address
Restricted Use API
This API requires special permission to access and may only be used in the context of verifying the address during the submission flow. It may not be used for any context outside of the submission process flow.
Introduction
This operation verifies an address against the USPS and provides suggested corrections.
Method | Service | API Name | Service Type |
---|---|---|---|
POST | submissions | verifyUSAddress â Explore | Synchronous |
URI: {baseUrl}/submissions/v1/verifyUSAddress
Header Elements
The header must contain the elements needed to authenticate the request.
Parameter | Description | Type | Required |
---|---|---|---|
authorization | This is where you will send your encoded JWT auth token you obtained from Get Auth Token. Must be in the form: Authorization: Bearer {auth-token-string} | String | Yes |
Request Elements
This service supports the following attributes in the request.
Name | Description | Type | Required |
---|---|---|---|
address1 | Address line 1. Must be 64 characters or less. | String | Yes |
address2 | Address line 2. Must be 64 characters or less. | String | No |
city | City must be 50 characters or less. | String | Yes |
state | Two character US state code | String | Yes |
postalCode5 | This is the US ZIP Code. This must be 5 characters. | String | Yes |
postalCode4 | This is the US ZIP Code +4 value. This must be 4 characters. | String | No |
country | This should always be "US". | String | No |
Sample Request
{
"address1" : "6220 Stoneridge Mall Rd",
"address2" : "",
"city" : "Pleasanton",
"state" : "CA",
"postalCode5" : "94588",
"country":"US"
}
Response
Upon success the service will response with an HTTP status code 200 and provide a JSON response containing the following attributes:
Name | Description | Type | Required |
---|---|---|---|
status | Response status. Possible values: - SUCCESS - ERROR | String | Yes |
errorCode | Required only when status is ERROR. Possible values: - VALIDATION_ERROR: invalid data | String | No |
errorDetails | Detailed information about error. Present only when status is ERROR. | String | No |
isValidAddress | Indicates if the address passed USPS validation. | Boolean | Yes |
isAddress2Invalid | It is a utility field to indicate that address 2 was either invalid or missing. Check returnText for more description. Possible values: - TRUE - NULL | Boolean | Yes |
isCityInvalid | It is a utility field to indicate that city was either invalid or missing. Check returnText for more description. Possible values: - TRUE - NULL | Boolean | Yes |
isAddressCleansed | Indicates if address was changed as part of address validation. | Yes | |
originalAddress1 | Contains the original value received in the request. | String | Yes |
originalAddress2 | Contains the original value received in the request. | String | Yes |
originalCity | Contains the original value received in the request. | String | Yes |
originalState | Contains the original value received in the request. | String | Yes |
originalPostalCode5 | Contains the original value received in the request. | String | Yes |
originalPostalCode4 | Contains the original value received in the request. | String | Yes |
originalCountry | Contains the original value received in the request. | String | Yes |
address1 | The value returned by USPS for address line 1. | String | Yes |
address2 | The value returned by USPS for address line 2. | String | Yes |
city | The value returned by USPS for city. | String | Yes |
state | The value returned by USPS for state. | String | Yes |
postalCode5 | The value returned by USPS for the ZIP Code. | String | Yes |
postalCode4 | The value returned by USPS for the ZIP Code +4. | String | Yes |
country | Will always be 'US'. USPS does not return country since they only validate US addresses. | String | Yes |
returnText | Additional information returned from the address validation service. This may include a DPV indicator: - Y = Address was DPV confirmed for both primary and (if present) secondary numbers. - D = Address was DPV confirmed for the primary number only, and Secondary number information was missing. - S = Address was DPV confirmed for the primary number only, and Secondary number information was present but unconfirmed. - N = Both Primary and (if present) Secondary number information failed to DPV Confirm. In the case of an address validation error this will contain the error detail returned from the service. This will be in the form of an SAP fault code. Fault code reference (external link). | String | No |
HTTP Response Status Code Reference
HTTP Status Code | Description | Action Needed |
---|---|---|
200 | OK The request was successful. | No additional action is needed. |
400 | Bad Request The request was improperly formatted. | Correct the formatting error and submit a new request. |
500 | Internal Server Error There was an internal error on the Blackhawk Network side. | Wait some time and retry the request. |
Sample Responses
{
"status": "SUCCESS",
"errorCode": null,
"errorDetails": null,
"isValidAddress": true,
"isAddress2Invalid": null,
"isCityInvalid": null,
"isAddressCleansed": true,
"originalAddress1": "6220 Stoneridge Mall Rd",
"originalAddress2": null,
"originalCity": "Pleasanton",
"originalState": "CA",
"originalPostalCode5": "94588",
"originalPostalCode4": null,
"originalCountry": "US",
"address1": "6220 Stoneridge Mall Rd",
"address2": "",
"city": "Pleasanton",
"state": "CA",
"postalCode5": "94588",
"postalCode4": "3260",
"country": "US",
"returnText": null
}
{
"status": "SUCCESS",
"errorCode": null,
"errorDetails": null,
"isValidAddress": false,
"isAddress2Invalid": null,
"isCityInvalid": null,
"isAddressCleansed": false,
"originalAddress1": "Test",
"originalAddress2": "200",
"originalCity": "Lewisville",
"originalState": "TX",
"originalPostalCode5": "75067",
"originalPostalCode4": null,
"originalCountry": "US",
"address1": null,
"address2": null,
"city": null,
"state": null,
"postalCode5": null,
"postalCode4": null,
"country": "US",
"returnText": "Fault code E420 received from SAP web service."
}
{
"status": "SUCCESS",
"errorCode": null,
"errorDetails": null,
"isValidAddress": false,
"isAddress2Invalid": true,
"isCityInvalid": null,
"isAddressCleansed": false,
"originalAddress1": "700 State Highway 121 bypass",
"originalAddress2": null,
"originalCity": "Lewisville",
"originalState": "TX",
"originalPostalCode5": "75067",
"originalPostalCode4": null,
"originalCountry": "US",
"address1": null,
"address2": null,
"city": null,
"state": null,
"postalCode5": null,
"postalCode4": null,
"country": "US",
"returnText": "DPV status D received from SAP web service."
}
{
"status": "ERROR",
"errorCode": "INVALID_REQUEST",
"errorDetails": "PostalCode:invalid",
"errorId": null
}
{
"status": "ERROR",
"errorCode": "TECHNICAL_ERROR",
"errorDetails": "Unexpected exception occured while verifying address."
}
Updated almost 5 years ago