M3 ideas


Home | Pages | Archives


Open source address validation of US addresses for Infor M3

July 13, 2014 3:18 am

As part of the open source address validation project for Infor M3, I just uploaded to the GitHub repository a sample script for Infor Smart Office to validate an address in the US using the United States Postal Service USPS Web Tools API. I provide the script as proof-of-concept for the interested reader to complete to suit their needs.

USPS Web Tools API

The USPS Web Tools API has the Verify and ZipCodeLookup APIs that validate one or more addresses using XML over HTTP GET:
1
2

Sample request/response

Here is a sample XML request and the URL:

https://secure.shippingapis.com/ShippingAPI.dll?API=Verify&XML=…

<AddressValidateRequest USERID="************">
   <Address>
      <FirmName>Ciber</FirmName>
      <Address1>6363 South Fiddlers Green</Address1>
      <Address2></Address2>
      <City>Greenwood Village</City>
      <State>CO</State>
      <Zip5></Zip5>
      <Zip4></Zip4>
   </Address>
</AddressValidateRequest>

Here is the XML response:

<?xml version="1.0" encoding="UTF-8"?>
<AddressValidateResponse>
   <Address>
      <FirmName>CIBER</FirmName>
      <Address1>STE 1400</Address1>
      <Address2>6363 S FIDDLERS GREEN CIR</Address2>
      <City>GREENWOOD VLG</City>
      <State>CO</State>
      <Zip5>80111</Zip5>
      <Zip4>5024</Zip4>
   </Address>
</AddressValidateResponse>

Sample script

Here is the sample script TestUSPS.js in Smart Office:
3

Here are the resulting XML and HTTP request and response:
4

 

That was how to do address validation for M3 in Infor Smart Office for US addresses using USPS Web Tools.

If you like this, please comment, subscribe, share, contribute to the project, donate your code. Thank you.

UPDATE: I would like to specially acknowledge the contribution of William Dale at Augusta Sportswear for allowing me to use his UPS and USPS accounts so I can do my tests and write the scripts. Thank you William!

Posted by thibaudatwork

Categories: Infor Smart Office Scripts, Integration

Tags: , , , ,

3 Responses to “Open source address validation of US addresses for Infor M3”

  1. Thibau i like this and the other address posts. I not only see this as used for validation but also possibly for Data Governance. Cleaning up existing incorrect data should be an activity every company prioritizes. The return on the investment in software systems is greatly reduced when the data your company relies on is incorrect.

    Like

    By boudreaupaul on July 14, 2014 at 6:25 am

    1. Indeed. Ideally, address validation would be integrated in Smart Office, at least as a checkbox to optionally turn on or off, same for phone number and email address validation, just like dates are validated.

      Like

      By thibaudatwork on July 14, 2014 at 10:16 am

  2. […] check out the samples for USPS and Eniro and the […]

    Like

    By Open source address validation for Infor M3 using UPS | M3 ideas on July 17, 2014 at 12:43 am

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.