

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
CANONICAL SHIPIT FREE
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, but excluding the shipit-api Heroku app mentioned above (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
CANONICAL SHIPIT INSTALL
Therefore, the guessCarrier() function returns an array, and we leave it up to the user to decide manually or through other automated means which carrier is the real one or provides more accurate tracking.Ĭlone this repo (or first fork it) git clone dependencies npm install Similar situation with UPS Mail Innovations as well. The tracking number used is the same between the two carriers. In such cases, FedEx provides tracking through most of the package's journey, and then USPS either takes over, or provides duplicate tracking in the last leg. For example, FedEx uses a service called SmartPost, where it relies on USPS to deliver the package at the last mile.

There's usually only one carrier that matches a tracking number (UPS is the only carrier that uses '1Z' prefix for its tracking numbers), but there are several cases, where there are multiple matches. This option can be overridden by a timeout attribute in the object passed on to the requestData() call.

raw - response includes the raw response received from the shipping carrier API.And those that don't require any credentials can be provided options as their first argument upsClient = new UpsClient credentials, Shipper clients that require account credentials can be provided options as their second argument. In the second case, shipit returns a timestamp attribute which has a UTC offset embedded in it, and also a datetime attribute which represents the local time. In the first case, since a timezone is not known, shipit just assumes UTC, and returns a timestamp attribute in the activity objects. And another that provide a timestamp, which includes a UTC offset. There are two types of shipping carriers - one that provide a date and time in their shipping activities that represents the local time at the location indicated. Note that orderId and shipmentId can be found in the URL embedded in the "Track your package" yellow button. log " new tracking data received # " if result ? Use it to initialize the shipper clients with your account credentials.Ĭonsole. Carriers supportedĪdd shipit to your package.json and then npm install it. It is only meant as a preview for the shipit node module. Note: shipit-api Heroku app is not meant for production use, and there are no guarantees included here, regarding it's availability, or up-time. Or try this, to detect the carrier(s) associated with a tracking number: For example, try this: Īnd replace ups with a canonical name for any of the supported carriers, and provide a valid tracking number for that carrier. There's a Heroku hobby app that allows you to see shipit in action. shipit provides a convenience function for this. That step is just totally unnecessary, given that we can guess the carrier from the tracking number in 90% of the cases.

Really, why do users have to know that a tracking number was provided by a particular carrier.
CANONICAL SHIPIT LICENSE
For carriers that expose tracking APIs, user is expected to acquire and provide credentials like license numbers, meter numbers, user IDs and passwords. It interfaces with tracking APIs when available, and falls back to screen scraping. Shipit is a node module that allows you to retrieve data from shipping carriers like UPS and FedEx in a common format.
