PHP: UPS Address Validation tool

Free php UPS address validation tool.

With UPS Address Validation, available in the latest XML technology, you don’t have to worry about your customers entering incorrect address information. If customers make a mistake, UPS Address Validation alerts them with an error message, ensuring that errors are corrected at the point of entry long before orders leave the shipping dock. This reduces costly returns for you and headaches for your customers.

UPS Address Validation uses U.S. Postal Service guidelines to thoroughly check the city, state and postal code of every shipment. UPS provides up to ten alternate addresses, including an accuracy rate that lets your customers know how closely the address they entered matches the suggested address.

In order to start using this UPS address validation tool you need to implement these steps:

  • Create a Tools UserId and Password.
  • License the Tools and receive your Developer Key.
  • Get an XML Access Key.

Do it at www.ec.ups.com

Here is some information how UPS address validator is working.
To receive Address Validation information, an application sends a request to the Address Validation interface.
The Address Validation request must contain one of the following input combinations:

  • City, State, and Postal Code
  • City
  • Postal Code
  • City and State
  • City and Postal Code
  • State and Postal Code

Once the request has been successfully submitted, the Address Validation tool returns the following output data for each match (the closest match is returned first):

  • Rank
  • Quality
  • City
  • State
  • Low-end postal code match
  • High-end postal code match

How to use this free PHP tool?

require_once("upsaddress.php");
$ups = new upsaddress("ACCESSKEY1234567", "userId", "password");
$ups->setCity("Miami");
$ups->setState("FL");
$ups->setZip("33110");
$response = $ups->getResponse();

And here is the response:


upsaddress Object
(
    [accessKey] => ACCESSKEY1234567
    [userId] => userId
    [password] => password
    [url] => https://wwwcie.ups.com/ups.app/xml/AV
    [city] => Miami
    [state] => FL
    [zip] => 33110
    [statuscode] => 1
    [statusdescription] => Success
    [error] =>
    [list] => Array
        (
            [0] => address Object
                (
                    [rank] => 1
                    [quality] => 1.0
                    [city] => MIAMI
                    [state] => FL
                    [zipLow] => 33110
                    [zipHigh] => 33112
                )
        )
)

Download free php UPS address validation tool

Please make a donation of 1$ if you find our software useful and want to support the continued development.


Thank you.

5 Comments

  1. Vasanthi says:

    Thank you so much for your post. Its very useful for me.

    I really appreciate for your article.

    Thank you for once again.

  2. Sunflower says:

    Thanks for the info. I don’t have a developer to install this. Can a developer contact me? Thanks

  3. Suresh says:

    Hi how to create “Access key” for the UPS address validation code…

    Thanks
    Suresh.M

Leave a Reply