It is very possible. However, you need to study the web sites of the various carriers in order to understand how you should pass them data in order to retrieve the shipment information.
Carrier tracking numbers have a different structure depending on the carrier, so you can quite easily parse them and understand the carrier they belong to.
There's however a caveat: some carriers might want tracking number to be passed via POST and not GET, and some might even check the referrer when a tracking request is issued. If this is the case with one of the carriers you use, you can't provide a direct link to you customers. Instead, you'll have to fetch yourself the information from the carrier's web site (using LWP for instance); then, you can parse the resulting page and display the shipment information on your web page.
For FedEx you might also want to take a look at modules such as Business::FedEx.
Hope this helps!
Michele.
| [reply] |
I'm currently assessing the number of carriers being used. I'm also contacting the two I know for sure.
Once I determine how the data should be passed to each carrier, how would my tracking number link know which carrier belongs to that tracking number?
| [reply] |
You have a couple of choices.
You can, as per phydeauxarff suggestion, modify your database so that, when entering tracking numbers, you also specify the carrier which they belong to. For instance, when you enter a code such as GE732387457WW (invented) you assign it manually to TNT.
As an alternative, you can just enter the tracking numbers and have your software determine which carrier they belong to. Just to stay with TNT, you know that a number which satisfies the regex:
/^GE\d{9}WW$/
is theirs. You can do the same for other carriers. If you choose this way, remeber that some carriers (i.e. UPS) have more that one format for their tracking numbers.
Michele. | [reply] [d/l] |
It sounds like you just need to have a carriers table
If I read you right, you could have a customers table with customer info, a carrier table with the carrier info, and in orders you would reference these by having each entry contain a customer and carrier ID that allows you to lookup that info. | [reply] |