Yellow Shipping CFC

Use Yellow for shipping? I’m working with a client who wants to use Yellow for shipping. They were interested in cutting costs a bit - so I wrote the Yellow integration for free in exchange for being able to open source it. Personally I’ve never even heard of Yellow before this project, so I don’t think many people will use this, but I’ve attached the CFC I created to this blog entry. No docs or anything fancy like that. The CFC basically just pings their service and parses the response into a simple structure.

There was one interesting tidbit to this code. When I hit their service I get a nice XML packet back. In some cases the zip you send may not be enough. Their service will respond by asking you to pick a particular city to narrow down the request. What is odd is that their response - in XML - is a set of HTML. For example:

<INPUT%20TYPE=HIDDEN%20NAME="shprZipForCities"%20VALUE="05495"%20>Origin%20City<select%20name="shprCities"%20size="1"><option%20value="ST%20GEORGE">ST%20GEORGE</option><option%20value="WILLISTON">WILLISTON</option></select>

I look for this response and parse out the cities so the error message can be checked. Probably not the most elegant solution, but it works.<p>Download attached file.</p>

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA https://www.raymondcamden.com

Comments