This package is aimed at wrapping the FedEx Tracking service in a simple to use PHP Library. Feel free to contribute.
This library uses PHP 5.3+.
To use the FedEx API, you have to request an access key from FedEx. For every request, you will have to provide the Access Key, Password, Account Number and Meter Number.
It is recommended that you install the PHP FedEx Tracking API Wrapper library through composer. To do so,
add the following lines to your composer.json
file.
{
"require": {
"maxirus/fedex": "dev-master"
}
}
The Track Class allows you to track a shipment using the FedEx Tracking API by simply providing a Tracking # or Order Tag number.
$tracking = new FedEx\TrackService\Track($accessKey, $password, $acctNum, $meterNum);
try {
$shipment = $tracking->getByTrackingId('TRACKING NUMBER');
var_dump($shipment);
} catch (Exception $e) {
var_dump($e);
}
Track parameters are:
trackingNumber
The package’s tracking number.