|
| 1 | +Track By Label ID |
| 2 | +====================================== |
| 3 | +[ShipEngine](www.shipengine.com) allows you to track a package by its ShipEngine label ID. Please see [our docs](https://www.shipengine.com/docs/tracking/track-by-label-id/) to learn more about tracking shipments. |
| 4 | + |
| 5 | +Input Parameters |
| 6 | +------------------------------------- |
| 7 | + |
| 8 | +The `trackUsingLabelId` method requires the ID of the label associated with the shipment you are trying to track. |
| 9 | + |
| 10 | +Output |
| 11 | +-------------------------------- |
| 12 | +The `trackUsingLabelId` method returns tracking information associated with the shipment for the given label ID. |
| 13 | + |
| 14 | +Example |
| 15 | +============================== |
| 16 | +```php |
| 17 | +use ShipEngine\ShipEngine; |
| 18 | +use ShipEngine\Message\ShipEngineException; |
| 19 | + |
| 20 | +function trackLabelWithLabelIdDemoFunction() { |
| 21 | + $client = new ShipEngine('API-Key'); |
| 22 | + try { |
| 23 | + print_r($client->trackUsingLabelId('se-75492762')); |
| 24 | + } catch (ShipEngineException $e) { |
| 25 | + print_r($e -> getMessage()); |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +trackLabelWithLabelIdDemoFunction(); |
| 30 | +``` |
| 31 | + |
| 32 | +Example Output |
| 33 | +----------------------------------------------------- |
| 34 | + |
| 35 | +### Tracking Result |
| 36 | +```php |
| 37 | +Array |
| 38 | +( |
| 39 | + [tracking_number] => 1Z63R0960322853130 |
| 40 | + [tracking_url] => http://wwwapps.ups.com/WebTracking/processRequest?HTMLVersion=5.0&Requester=NES&AgreeToTermsAndConditions=yes&loc=en_US&tracknum=1Z63R0960322853130 |
| 41 | + [status_code] => UN |
| 42 | + [carrier_code] => ups |
| 43 | + [carrier_id] => 3 |
| 44 | + [carrier_detail_code] => |
| 45 | + [status_description] => Unknown |
| 46 | + [carrier_status_code] => |
| 47 | + [carrier_status_description] => No tracking information available |
| 48 | + [ship_date] => |
| 49 | + [estimated_delivery_date] => |
| 50 | + [actual_delivery_date] => |
| 51 | + [exception_description] => |
| 52 | + [events] => Array |
| 53 | + ( |
| 54 | + ) |
| 55 | + |
| 56 | +) |
| 57 | +``` |
0 commit comments