UPS Rate Request Class – PHP
Download UPS Rate Request Class – PHP
Several months ago a project came to me to add UPS shipping to a client’s online store. Up to that point they were charging a single flat shipping fee for all orders. As a merchant who sells everything from decals to racecar chassis, the one-size-fits-all approach to shipping was cutting into profits. So I went in search of some sort of PHP code, a class or library or something, that I could plug into the store code. At the time there wasn’t much out there.
Maybe most online stores out there are using OS Commerce or Magento or some other pre-packaged solution. Unfortunately that really wasn’t an option and I ended up writing my own class based off the UPS Developer API. It worked pretty well, so this week I’ve cleaned it up, wrote a simple form and supporting code and packaged it up for your consumption. Feel free to download it and use it in your application.
The iframe below contains a working example of the class. The class handles both rate requests for specific rates (if you know you want to ship UPS Ground for example) or rate comparison requests (if you want to see what different services will cost). It also handles international shipping.

Leave a Reply
You must be logged in to post a comment.