Skip to main content

Address Validation

UPS Address Validation

POST https://onlinetools.ups.com/rest/XAV

Address verification endpoint

Request Body

NameTypeDescription
application/json*stringSee Body Example Below

title="200: OK " The response will be an object you can then use the candidate details for label creation

{
"XAVResponse": {
"candidate": {
"AddressKeyFormat": {
"ConsigneeName": null,
"BuildingName": null,
"AddressLine": "765A N MAIN ST",
"PoliticalDivision1": "CT",
"PoliticalDivision2": "DANIELSON",
"PostcodePrimaryLow": "06239",
"PostCodeExtendedLow": "1630",
"Region": "DANIELSON CT 06239-1630",
"CountryCode": "US"
}
},
"AmbiguousAddressIndicator": "false",
"ValidAddressIndicator": ""
}
}

title="200: OK Bad Address" Sending an address that does not work within UPS will result in all NULL values in the validation.

{
"XAVResponse": {
"candidate": {
"AddressKeyFormat": {
"ConsigneeName": null,
"BuildingName": null,
"AddressLine": null,
"PoliticalDivision1": null,
"PoliticalDivision2": null,
"PostcodePrimaryLow": null,
"PostCodeExtendedLow": null,
"Region": null,
"CountryCode": "US"
}
},
"AmbiguousAddressIndicator": "false",
"ValidAddressIndicator": "false"
}
}
// UPS Address Validation Request

{
"UPSSecurity": {
"UsernameToken": {
"Username": "XXXXXXX",
"Password": "XXXXXXX"
},
"ServiceAccessToken": {
"AccessLicenseNumber": "LICENSENUMBER"
}
},
"XAVRequest": {
"Request": {
"RequestOption": "1"
},
"MaximumListSize": "10",
"AddressKeyFormat": {
"ConsigneeName": "justin Porter",
"BuildingName": "Text Connects",
"AddressLine": "765 N Main St",
"PoliticalDivision1": "CT",
"PoliticalDivision2": "Danielson",
"PostcodePrimaryLow": "06281",
"CountryCode": "US"
}
}
}

NOTE: Responses can be an object, like described above, OR can be an array of objects, which suggests there are more than 1 valid addresses for the entry and typically we suggest human validation at that point.