Pos Malaysia shipping quotes for e-commerce

February 23rd, 2010 | by Sean |
Pos Malaysia

Pos Malaysia

I maintain some Malaysian shipping modules for the popular e-commerce software osCommerce which allow local e-shops to include up-to-date automatic shipping quotes from Pos Malaysia (Pos Laju and Pos Air Parcel) in the order total. If you run an e-shop, being able to pass on accurate shipping costs to your customers – compared with ‘free’ or fixed-price shipping – means you can give your customers better prices than your competitors. If you can offer your customer a choice of shipping options, this also allows them to save money or expedite their delivery. Doing all of this automatically means you don’t have to attend to your online business – it completes orders and collects money for you, and tells you when to pack deliveries!

Pos Malaysia have a shipping quotation service at their website. It’s obviously intended for human visitors, as it also has advertising, branding and links to other services on it. I use this web page in my osCommerce module. In order to give an automatic, up-to-date quote, an osCommerce shop using my modules must send a request to Pos Malaysia’s website, read the entire page, and use pattern matching to extract the shipping price.

The current technique is very wasteful of resources, the page that must be searched for the shipping price is 13 to 15KB – for just a few characters! The technique is also horrendously sensitive. If Pos Malaysia change the appearance of the page, the pattern-matching technique can’t work and the shipping module fails to return a quote, which will usually mean that the osCommerce e-shop won’t be able to complete the order. The Internet being the ‘instant’ experience that it is, the sales opportunity is probably lost.

One further annoyance is that the shipping module requesting one or two (for different shipping methods) quotes from Pos Malaysia’s website introduces a considerable delay in the user’s experience of the e-shop. When a customer goes to the checkout page on which the shipping cost appears, the server starts to build the page, sends a request to Pos Malaysia’s website, waits for Pos Malaysia’s webserver to build its response, reads the (large) response, performs pattern matching on it (repeating the last 4 steps for each additional shipping method) and finally sends the page to your customer’s browser. Several-second delays are not uncommon.

Pos Malaysia quotation page timings

Pos Malaysia quotation page timings

Take a look at these two resource timing graphs from the Chromium browser. If you haven’t used Chromium yet, and you’re a developer, there are some great tools in there – and it’s shaping up to be a very competent browser too. The first image is from Pos Malaysia’s website, a shipping quote for a parcel (surface and air quotes on the same page). The blue bar is for the page itself – the other bars are for resources the page needs to be rendered. We only need the page, as we’re not interested in images, stylesheets and scripts, only in the text of the shipping amounts. There’s a redirect (a 302 Found) which further slows things down, and then a 104ms wait (perhaps the page is being built by Pos’s server?) and then nearly a quarter of a second while the ~14KB of the page text is transferred.

AJAX load time from spider.my's currency conversion page

AJAX load time from spider.my's currency conversion page

Compare that with this image, which shows the resources being loaded from spider.my’s currency conversion page. The line to note is that for the AJAX update of the exchange rate. The latency is horrible, as spider.my is hosted in the USA, but the time to load the AJAX update is only 1ms – hundreds of times faster than Pos’ shipping quote page. That’s understandable because the reply from spider.my is only about 100bytes long!

What I think Pos Malaysia should do is to provide an API to Malaysian e-business so that their postal services can be more efficiently and reliably built into local business systems. I think they should offer 2 APIs – one a simple AJAX responder for use on blog pages and low-volume shops, and the other a shipping rates updater for larger-volume businesses. The simple responder would take the place of the current osCommerce modules and should be able to easily serve thousands of shipping quote requests per second on any old PC that Pos has lying around. I envisage some heavy client-side caching for the high-volume API, so apart from days on which Pos update their rates, the server should see very little traffic at all for a more complex solution suitable for large businesses.

It was obvious to me when I first wrote the shipping modules a few years ago that they were inefficient and fragile, so I emailed and wrote to Pos Malaysia, even met their regional management to try to get someone to improve their end of the shipping quote system. A few years have passed and nothing has happened, so I’m going to write it myself and try to get someone from Pos to have a look at it and hopefully host it themselves. It’s not difficult and it’ll make a nice test of Spinneret. After all, when I finally get round to making Spinneret available, it will be FOSS buatan Malaysia!

If Pos wants the system, I’d be quite happy to do all the necessary work to integrate it into Pos Malaysia’s current IT systems FOR FREE. I don’t want to maintain the osCommerce modules in their current condition any more, and I think Pos exposing a decent API to local e-businesses would make a big difference to the ability of Malaysian businesses to compete online. That would make my life easier, and hopefully earn me a few free cups of tea at the kopitiam.

  1. 9 Responses to “Pos Malaysia shipping quotes for e-commerce”

  2. By Malaysia Package Deals on Apr 22, 2010 | Reply

    Have you made any progress on this? It seems silly they would ignore your generous offer.

  3. By Sean on Apr 22, 2010 | Reply

    That comment was sooo difficult to decide approve/spam! Not mentioning any words from the article, I would normally automatically spam it – like “Hey! That’s what I think too!” and “I respect your awesome opinion” comments that I get from “viagra@realbig.co.cc” all the time.

    I have made progress, but none on getting a response from Pos. I can tell from my logs that many of the emails I’ve sent to people associated with Pos have been read and the links clicked (you have to love web-based email clients), but I’m guessing I haven’t been clear enough, or the problem of 30% ‘facilitation and coordination’ fee on ‘free’ has been a deciding factor.

    I should be clearing off all the demo pages sometime next month when I revamp spider.my – it’s going back to being a search engine again. I’ve mostly solved the reliability problems that made me take search off last time. The shipping quote service will be built into the search box like the calculator at Google. I’ll also offer it as part of a spider.my API. The e-commerce shipping modules I maintain could do with a bit of a freshen-up, but I can’t motivate myself to do anything that depends on Pos’ website again – so the new modules will use the spider.my API and offer a few new interesting features.

    I’m going to have to find a way of charging for, or generating benefit from the API though – it’s harder for me to offer the service than it would be for Pos, so that tricky little problem I have yet to solve!

  4. By Chu Tzu Ming on Jul 15, 2010 | Reply

    These guys don’t know what is good and needed so they will always remain status quo, ie they won’t do anything. Let me know how you get along with your tool.

  5. By li on Jul 16, 2010 | Reply

    hi, would you be able to install this module into a CK Gold cart? I would totally pay for it, Accurate shipping charges are my biggest headache..

  6. By Sean on Jul 17, 2010 | Reply

    The ‘next month’s are looking a bit optimistic, aren’t they? I should have spider.my replaced with the revamped search engine front end this week. I’m pretty close, just need to make a few last-minute back-end ‘adjustments’. Thanks for the interest!

  7. By Sean on Jul 17, 2010 | Reply

    Should be as easy as falling off a log if they have an API. I think I’ve just sent them a request for an API at cartkeeper.com. Their website seems to have a couple of ‘issues’ so I’m hoping that the empty ‘thanks.php’ page I got means I have successfully asked the question. I’ll let you know what they say. I’m back to work on the shipping API this week when spider.my’s new front end goes online. My plan is to provide shipping modules for e-commerce projects for free and provide paid API-access for heavier users. Just out of interest, does CKGold ‘know’ the weight and size of your parcels at checkout time? It looks like it does from their demo site – it’s a bit locked down to see for sure. Are your shipments below 20kg?

  1. 3 Trackback(s)

  2. Feb 24, 2010: Pos Malaysia e-commerce shipping quote with AJAX
  3. Feb 26, 2010: Pos Malaysia Shipping Widget for your website
  4. Mar 7, 2010: Online Bisnes » Pos Malaysia shipping quotes for e-commerce

Post a Comment