End Point Corporation
Services   |   Our Clients   |   Interchange   |   Ruby on Rails   |   PostgreSQL   |   Hosting   |   About Us   |   Contact
Tech News
End Point Home > Tech News
Tech News

USPS changes the Web Tools Rate Calculator API
by Dan Collis-Puro
May 14, 2007

End Point offers integration with online shipping APIs to provide "live lookups" of rates.

Advantages of "live lookups":
  • Current rates
  • Includes additional costs such as fuel surcharges
  • No manual maintenance of rate tables
Disadvantages of "live lookups":
  • Dependent on the availability and performance of the rate service
  • Planning, programming and rolling out API changes
CH CH CH CH CHANGES!

Speaking of changes, the USPS has changed shipping rates as of May 14, 2007 (non-tech-friendly details here). The changes include updates to rates, package attributes and shipping methods. These changes impact the XML-based Web Tools Rate Calculator, in some cases breaking lookups altogether. As of press time, the USPS hasn't documented the changes to the API. Broken lookups appear to be confined mostly to international shipping.

Many of the changes represent a simplification and restructuring of international shipping methods, detailed here. This tweaking of international shipping methods is definitely an improvement — there were too many confusing options before. Unfortunately, these tweaks aren't backwards compatible — meaning nearly all old-style international API lookups are broken. The USPS still (as of press time) hasn't documented technical changes to the API.

TECHIE BACKGROUND - OR "HOW THINGS GOT BROKEN"

When you send an international rate request, the USPS API returns a "response" XML packet that includes the available shipping methods, e.g. "EXPRESS MAIL INTERNATIONAL (EMS)". Most of these shipping method names have changed in the response, leaving rate calculation code developed against the last released API in a broken state — you can't match a requested rate to a specific response.

Fortunately, the USPS has provided an undocumented staging API for customer testing, so we've been able to deduce most of the changes to the shipping method names through a battery of tests. Unfortunately, until the USPS releases new documentation we're left with an educated guess as to how to fix broken lookups.

CONCLUSION

The changes to international shipping methods are refreshing. However, the USPS release of an undocumented API into production for all customers has left developers guessing, especially since those changes aren't backwards-compatible.

SELECTED TIMELINE OF API CHANGES
  • March 21, 2007. USPS notifies users that the Rate Calculator API will be changing
  • April 26, 2007. USPS notifies users that they can use the staging API for testing ... on April 19.
  • May 14, 2007. USPS switches to the still undocumented production API, breaking most international rate calculation lookups in the process.
Recent Tech News Features
Recent Tech News Features
DBD::Pg 2.0.0 released
Better Git it in Your Soul
Bucardo: Replication for PostgreSQL
RailsConf 2007 Conference Report
Get Out of Technical Debt Now!
Red Hat Enterprise Linux 4 Security Report
Evangelizing Test-Driven Development
USPS changes the Web Tools Rate Calculator API
New edition of The Book of JavaScript reviewed
Interchange 5.4.2 released
Greg Sabino Mullane's PostgreSQL tips and how-to articles
Hardware Monitoring with Nagios on OpenBSD
YAPC::NA 2006 Conference Report
Practices of an Agile Developer Reviewed
Trouble with MySQL 4.1 under heavy load
Interchange 5.4.1 released
PostgreSQL Supports Two-Phase Commit
DBD::Pg 1.48 Released
Interchange 5.4 Released
PostgreSQL 8.1 Shows Database Progress
Red Hat Enterprise Linux 3 Update 3 Released
© 2008 End Point Corporation. 920 Broadway Suite 701, New York, NY 10010 USA | Tel +1 212-929-6923 or 1-888-351-3239 | Fax +1 212-929-6927