PHParcel

PackageServices_Shipping is a PEAR package that provides a common API for processing shipments with UPS, DHL, and other XML-like carriers with PHP versions 5 or later. In a nutshell here is what it supports:

Cost & Time Estimate
All carriers support estimation of cost, and typically estimation of time. Most carriers describe packages the same when estimating them as when actually scheduling a shipment, and that code will be shared and the usage consistent. You don’t have to worry about quoting a shipment and then later shipping a different package by accident.

Parcel Features
Different carriers support all kinds of additional features such as Insurance, Age/Signature Verification,  and rush delivery options. Our API provides a simple way to implement new features. Each carrier implements a feature a different way, but unless you’re using features specific to a carrier, then your feature will be described the same way in code for all supporting carriers.

Image Labels
Your application probably needs to print or do something with the generated shipping label, so we make it easy to get the image in a file format you need, even if the shipping API uses another encoding. It’s easy to extend and write custom label generation routines without re-inventing the wheel. This uses the native GD Image functions in PHP.

PEAR Extendable
Want to add support for a carrier? Just create a PEAR package called Services_Shipping_YourCarrier and install it into PEAR. The carrier name should be short and all uppercase. Since we expose what carriers are available, other applications don’t have to be recoded to use the new shipping carrier.

Download

Grab the latest release.

License

The code is licensed under the Lesser General Public License (LGPL) In short, you can use this code, but if you alter the Services_Shipping code you need to share. You don’t have to share any code outside this component.

Source Code

All source code for Services_Shipping is available in our Source Code Repository, and can be obtained easily by:

bzr branch http://santiance.com/bzr/Services_Shipping