2

I am using UPS API for address validation. I am very new to this API and have just started learning.

  1. I want to validate an address based on only zipcode i.e. I don't want to suppy the State name. It is not working in Test Integration environment. Any help?

  2. I want to validate address using only Street Address and Zipcode. I don't want to supply State & City name. Is that possible? So far not working.

If I provide both State & Zipcode it is working nice.

Matt
  • 22,721
  • 17
  • 71
  • 112
user1277719
  • 99
  • 3
  • 6
  • You'd do well to go back and accept answers to your previous questions before expecting to get a good one here. – Matt May 16 '12 at 05:46

4 Answers4

1

How committed are you to the UPS API? My experience is that if they don't have it in the API already, it won't happen soon. There are other APIs available that will let you verify an address based on only the address and the ZIP code. typically, it is not necessary to provide a city or state if you have the correct ZIP code. The minimum required for address validation is street address and zip code or street address and city/state. how many addresses to need to verify each month? If you don't need a whole lot, there are a number of free APIs available. National address server is one, SmartyStreets.com is another. (I work for SmartyStreets.com.)

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Jeffrey
  • 502
  • 2
  • 10
  • thank you very much. I am looking for some address validation API that I can use in my web app. I am not planning to ship anything so probably UPS validation I can't use. Does National Address or SmartyAddress api work in iPhone/Android in case I develop i/Os application and want to perform address validation there? – user1277719 May 18 '12 at 00:27
  • As a web API, SmartyStreets LiveAddress can be called from any web-enabled device. Accessing the API is as simple as a URL request. – Jeffrey May 18 '12 at 05:29
  • thank you. I will study this API now and try to invoke from my PHP code as first attemt. Will ask question if I am stuck somewhere. – user1277719 May 22 '12 at 00:38
  • Just a short add on, the LiveAddress API that I mentioned before can now validate city/state/ZIP in the absence of an address. It's a different endpoint (http://smartystreets.com/kb/liveaddress-api/zipcode-api) – Jeffrey Dec 28 '12 at 22:35
0

If you provide blank values for PoliticalDivision1 and PoliticalDivision2 the result back should include the city and state. You must still provide a valid address.

andyknas
  • 1,939
  • 2
  • 15
  • 29
0

In a C++ application the following XML input used in street level address validator UPS API. Please use appropriate licence number, user id and password.

<?xml version=\"1.0\"?>
<AccessRequest   xml:lang=\"en-US\"><AccessLicenseNumber>{LicenceNo}</AccessLicenseNumber><UserId>{UserId}</UserId><Password>{Passwd}</Password></AccessRequest>
<?xml version=\"1.0\"?>
<AddressValidationRequest xml:lang=\"en-US\">
  <Request><TransactionReference><CustomerContext>Your Test Case Summary Description</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><RequestAction>XAV</RequestAction><RequestOption>3</RequestOption>
  </Request>
  <AddressKeyFormat><AddressLine>608 E. Evergreen Rd</AddressLine><PoliticalDivision2>LEBANON</PoliticalDivision2>    <PoliticalDivision1>PA</PoliticalDivision1><PostcodePrimaryLow>17042</PostcodePrimaryLow><CountryCode>US</CountryCode> </AddressKeyFormat>
</AddressValidationRequest>

and following output received.

<?xml version=\"1.0\"?>
<AddressValidationResponse>
  <Response>
    <TransactionReference><CustomerContext>Your Test Case Summary Description</CustomerContext> <XpciVersion>1.0</XpciVersion></TransactionReference> <ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription>
  </Response>
  <ValidAddressIndicator/>
  <AddressClassification><Code>1</Code><Description>Commercial</Description></AddressClassification>
  <AddressKeyFormat><AddressClassification><Code>1</Code><Description>Commercial</Description></AddressClassification><AddressLine>608 E EVERGREEN RD</AddressLine><Region>LEBANON PA 17042-7925</Region><PoliticalDivision2>LEBANON</PoliticalDivision2><PoliticalDivision1>PA</PoliticalDivision1><PostcodePrimaryLow>17042</PostcodePrimaryLow><PostcodeExtendedLow>7925</PostcodeExtendedLow><CountryCode>US</CountryCode></AddressKeyFormat>
</AddressValidationResponse>
Pabitra Dash
  • 1,461
  • 2
  • 21
  • 28
0

Another potential solution besides the UPS API is the Service Objects address validation web service. Full disclosure, I work for Service Objects, but the web service objectively fits your needs.

It can process addresses with just the address1 and zipcode fields. The web service can validate the information, append the city, state, zip+4, note any corrections/changes, and provide a Delivery Point Validation (DPV) code indicating the address's deliverability. Below is an example input and output showing the actual service response.

If you are interested in trying out the API a free trial key is available for testing. You want to get more information about the nitty gritty technical details check out the Developer Guide

Example Input:

Address1: 27 E Cota St Ste 500

Zipcode: 93101

{
  "Addresses":[
      {
        "Address1":"27 E Cota St Ste 500",
        "Address2":"",
        "City":"Santa Barbara",
        "State":"CA",
        "Zip":"93101-7602",
        "IsResidential":"false",
        "DPV":"1",
        "DPVDesc":"Yes, the input record is a valid mailing address",
        "DPVNotes":"26,28,39",
        "DPVNotesDesc":"The input address matched the ZIP+4 record,The input address matched the DPV record,Highrise apartment\/office building address",
        "Corrections":"10,23",
        "CorrectionsDesc":"City change,State change",
        "BarcodeDigits":"931017602254",
        "CarrierRoute":"C006",
        "CongressCode":"24",
        "CountyCode":"083",
        "CountyName":"Santa Barbara",
        "FragmentHouse":"27",
        "FragmentPreDir":"E",
        "FragmentStreet":"Cota",
        "FragmentSuffix":"St",
        "FragmentPostDir":"",
        "FragmentUnit":"Ste",
        "Fragment":"500",
        "FragmentPMBPrefix":"",
        "FragmentPMBNumber":""
      }
  ],
  "IsCASS":true
}