php-ups-api: Failure: Invalid tracking number (150022)

When I try to use your api I get this error with valid tracking numbers. From what I can tell, your api looks good. Have there been any changes to the UPS api service lately that could break your API?

<?php
date_default_timezone_set('America/Phoenix');
require_once('vendor/autoload.php');

$accessKey="secret";
$userId="secret";
$password="secret";

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

try {
    $shipment = $tracking->track('I_USED_A_VALID_TRACKING_NUMBER_HERE');

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

        var_dump($activity);
    }

} catch (Exception $e) {
    echo "exception thrown";
    var_dump($e);
}

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

This is what I got from UPS dev support…

Thank you for this reply. Unlike your first request, this one is missing the Include Mail Innovation Indicator.

If you add this the element the request will work in the test or production servers.

<?xml version="1.0" encoding="UTF-8"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>444444SECRET4444</AccessLicenseNumber>
<UserId>SECRET</UserId>
<Password>SECRET</Password>
</AccessRequest>
<?xml version="1.0" encoding="UTF-8"?>
<TrackRequest xml:lang="en-US">
<IncludeMailInnovationIndicator/>
<Request>
<TransactionReference/>
<RequestAction>Track</RequestAction>
<RequestOption>activity</RequestOption>
</Request>
<TrackingNumber>92748999SECRET03860</TrackingNumber>
</TrackRequest>