Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hm122 committed Mar 2, 2016
1 parent cfcc773 commit 7641acf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,34 @@ Tracking parameters are:
* `referenceNumber` The ability to track any UPS package or shipment by reference number. Reference numbers can be a purchase order number, job number, etc. Reference Number is supplied when generating a shipment.
* `requestOption` Optional processing. For Mail Innovations the only valid options are Last Activity and All activity.

<a name="tracking-class-example"></a>
### Example using Reference Number with additional parameters

```php
$tracking = new Ups\Tracking($accessKey, $userId, $password);

$tracking->setShipperNumber('SHIPPER NUMBER');

$beginDate = new \DateTime('2016-01-01');
$endDate = new \DateTime('2016-01-31');

$tracking->setBeginDate($beginDate);
$tracking->setEndDate($endDate);

try {
$shipment = $tracking->trackByReference('REFERENCE NUMBER');

foreach($shipment->Package->Activity as $activity) {
var_dump($activity);
}

} catch (Exception $e) {
var_dump($e);
}
```

The parameters shipperNumber, beginDate and endDate are optional. Either of the parameters can be set individually. These parameters can help to narrow the search field when tracking by reference, since it might happen that the reference number used is not unique. When using tracking by tracking number these parameters are not needed since the tracking number is unique.

<a name="rate-class"></a>
## Rate Class

Expand Down

0 comments on commit 7641acf

Please sign in to comment.