tags:

views:

779

answers:

1

I know that UPS has some APIs they make available for doing shipping calculations. Is it possible to create a shipment and PDF shipping label using the UPS APIs with PHP? Does anyone have any working sample code?

+1  A: 

I recently performed an integration using ups-php.

The project seems to have advanced much since then, and supports the most common actions (Rate, Track, Ship, Void) in the development version. It's not finished software, but it's easy to use and build on if required.

The class can be used to get shipping labels and you specify formats and print methods inside the upsShip class. The labels are returned inside the XML response in base64 GIF for you to print out/save.

    //Response from UPS

    $label = $responseArray['ShipmentAcceptResponse']['ShipmentResults']['PackageResults']['LabelImage']['GraphicImage']['VALUE'];
arbales
Thanks, I had looked at that but hadn't noticed that the latest svn builds have shipping support.
Keith Palmer
I didn't realize it at first either, I was actually pretty relieved for the time-saving.
arbales