Shipwire Tracking API – Mapping API carrier codes in Tracking updates within Magento

September 30, 2010

This is just a quick note that might save someone some time/effort. I’ve been working with the Shipwire Tracking API and Magento lately and although I think their API is good, it’s lacking in certain areas. Namely utility for customer facing applications.

The Shipwire tracking API returns short codes for carrier and service, which doesn’t really make it very useful for customer facing communication, nobody wants to know their parcel shipped on “RM FCLR“, instead of Royal Mail First Class Large Letter – Recorded Signed For. I contacted Shipwire support about it and they provided the comprehensive list of carriers and codes (thanks Gene!).

Here it is as a php array:

private $_carrierCodes = array(
'DHL 1D' =>   'DHL Next Afternoon',
'DHL 2D' =>   'DHL 2nd Day',
'DHL GD' =>   'DHL Ground',
'DHL WPE' =>   'DHL Worldwide Priority Express',
'UPS 1D' =>   'UPS Next Day Air',
'UPS 2D' =>   'UPS Second Day Air',
'UPS 3D' =>   'UPS Three-Day Select',
'UPS GD' =>   'UPS Ground',
'UPS WSV' =>   'UPS Saver',
'UPS WXP' =>   'UPS Expedited',
'UPS ST' =>   'UPS Standard',
'UPS WXS' =>   'UPS Express',
'USPS XP' =>   'USPS Express Mail',
'USPS XPFE' =>   'USPS Express Mail Flat-Rate Envelope',
'USPS PM' =>   'USPS Priority Mail + Delivery Confirmation',
'USPS PMFE' =>   'USPS Priority Mail Flat-Rate Envelope + Delivery Confirmation',
'USPS PMFB' =>   'USPS Priority Mail Flat-Rate Box + Delivery Confirmation',
'USPS PMLB' =>   'USPS Priority Mail Large Flat-Rate Box + Delivery Confirmation',
'USPS PP' =>   'USPS Parcel Post',
'USPS FC' =>   'USPS First-Class Mail Parcel + Delivery Confirmation',
'USPS MM' =>   'USPS Media Mail',
'USPS EMI' =>   'USPS Express Mail International',
'USPS PMI' =>   'USPS Priority Mail International',
'USPS FCI' =>   'USPS First-Class Mail International',
'CP RP' =>   'Canada Post Regular Parcel',
'CP EP' =>   'Canada Post Expedited Parcel',
'CP XP' =>   'Canada Post Xpresspost',
'CP PC' =>   'Canada Post Priority Courier',
'CP EXUB' =>   'Canada Post Expedited US Business',
'CP XPU' =>   'Canada Post Xpresspost USA',
'CP PUR' =>   'Canada Post Purolator International',
'CP PA' =>   'Canada Post Parcel Air',
'CP XPI' =>   'Canada Post XPressPost International',
'PUR XP' =>   'Purolator Express',
'PUR GD' =>   'Purolator Ground',
'PUR XPUS' =>   'Purolator Express US',
'PUR GDUS' =>   'Purolator Ground US',
'PUR XPI' =>   'Purolator Express International',
'FDX FT' =>   'FedEx Freight',
'FDX GD' =>   'FedEx Ground',
'FDX GDH' =>   'FedEx Home Delivery',
'FDX 1D' =>   'FedEx Standard Overnight',
'FDX 1DP' =>   'FedEx Priority Overnight',
'FDX IP' =>   'FedEx International Priority',
'FDX IE' =>   'FedEx International Economy',
'FDX 2D' =>   'FedEx 2Day',
'RM SDND' =>   'Royal Mail Special Delivery Next Day',
'RM FCL' =>   'Royal Mail First Class Large Letter',
'RM SCL' =>   'Royal Mail Second Class Large Letter',
'RM FCP' =>   'Royal Mail First Class Packet',
'RM SCP' =>   'Royal Mail Second Class Packet',
'RM SP' =>   'Royal Mail Standard Parcels',
'RM FCLR' =>   'Royal Mail First Class Large Letter - Recorded Signed For',
'RM SCLR' =>   'Royal Mail Second Class Large Letter - Recorded Signed For',
'RM FCPR' =>   'Royal Mail First Class Packet - Recorded Signed For',
'RM SCPR' =>   'Royal Mail Second Class Packet - Recorded Signed For',
'RM AM' =>   'Royal Mail Airmail',
'RM AMS' =>   'Royal Mail Airsure',
'RM ISF' =>   'Royal Mail International Signed For',
'PF 1D' =>   'Parcelforce 24',
'PF 2D' =>   'Parcelforce 48',
'PF DP' =>   'Parcelforce International Datapost',
'PF EU' =>   'Parcelforce Euro 48',
'PF ISC' =>   'Parcelforce International Scheduled',
'PF IST' =>   'Parcelforce International Standard',
'PF IEC' =>   'Parcelforce International Economy',
'PH HE' =>   'Pharos Hercules',
'ET GD' =>   'Eurotrux Ground',
);

And you can probably imagine how it can be used, but to spell it out:

if(isset($this->_carrierCodes[$code])) {
	$code = $this->_carrierCodes[$code];	
}

Also, in case there is anyone needing the data for a different reason, here’s the csv file of the codes to titles.

While I’m whinging about the API and in case this gets a Shipwire API developer’s attention – could you please make the UI information available in a web service, like tracking links for the carriers (when available) and delivery estimates. Both are great for customer communication, but lacking in the API currently.

On a more positive note, I’ve worked with webservices from many different warehouses and different geographies and I’d have to say that despite it’s shortcomings – the Shipwire API is one of the better ones for ease of integration.

Ashley

Posts

Hi! I'm Ashley Schroder, a Software Engineer from New Zealand - this is a collection of notes on my experiences with Ecommerce Web Development, particularly Magento Development.

Are Your Customers Getting The Magento Emails You Send?

MageSend Magento Email sending with Amazon SES

I have made a premium Magento Extension called MageSend. MageSend makes it simple and easy to send using Amazon's highly reliable SES email service.

The extension is $99, and comes with a complete money back guarantee, please check it out, I am confident it will resolve any email sending problems with your Magento store.

6 responses to Shipwire Tracking API – Mapping API carrier codes in Tracking updates within Magento

  1. Ashley,

    Shipwire software team saw this incredibly thoughtful and helpful post.

    Your request has been slotted for development. We do monthly releases, hoping to see this inside of two months.

    Thank you for your kind words about our API and dev support team.

    Nate Gilmore
    Shipwire Team

  2. Ashley,

    Did you see that we launched a new feature set so that more customers can benefit from this tracking API?

    It’s basically free Magento Order Management, inventory management and label printing (USA only today). You can add your own locations to Shipwire – these are places where you manage the inventory and just need to use our software platform for shipping rates and order management.

    http://www.shipwire.com/anywhere

    Curious as to your thoughts; we’re still learning all the use cases.

    Nate

  3. Thanks for stopping by Nate – great to hear the info might be available soon in your API. I had seen the anywhere service actually, I thought it looked promising, a logical next step for you guys, and a good first step for many smaller merchants.

  4. Ashley,

    Thanks for this very helpful post.

    We’ve integrated some of your suggestions into a recent tracking API update. I hope you find these useful:

    http://www.aschroder.com/2010/09/shipwire-tracking-api-mapping-api-carrier-codes-in-tracking-updates-within-magento/

  5. Thanks Evan, looking forward to it – apologies this comment took a while to show up – incorrectly flagged as spam by Akismet.

  6. andrea holmes July 20, 2011 at 5:11 am

    need 2 know if my parcel has reached its destination