Search code examples
postmanups

The UPS testing url for their Tracking REST API returns the same response every time


Summary

The UPS API testing environment (Customer Integration Environment, or CIE) does not work as outlined in the docs. Is anyone else experiencing this, or am I missing something?

Problem

The UPS Developer Kit for the tracking API contains the 'Tracking RESTful Developer Guide.pdf'. It lists tracking numbers for generating test responses: UPS tracking numbers for testing CIE

However, when trying test tracking number 1Z5338FF0107231059 (which should return a delivery attempted status), it returns a different tracking number response (note the different inquiry/tracking number)

{"trackResponse":{"shipment":[{"inquiryNumber":"1Z1442YY7229014688","package":[{"trackingNumber":"1Z1442YY7229014688","deliveryDate":[{"type":"DEL","date":"20220126"}],"deliveryTime":{"type":"DEL","endTime":"163000"},"activity":[{"location":{"address":{"city":"PARAMUS","stateProvince":"NJ","countryCode":"US","country":"US"},"slic":"0761"},"status":{"type":"D","description":"DELIVERED ","code":"F4","statusCode":"011"},"date":"20220126","time":"163000"},{"location":{"address":{"countryCode":"US","country":"US"}},"status":{"type":"M","description":"Shipper created a label, UPS has not received the package yet. ","code":"MP","statusCode":"003"},"date":"20220126","time":"151641"}],"packageCount":1}]}]}}

The GET request url:

https://wwwcie.ups.com/track/v1/details/1Z5338FF0107231059

The headers include all necessary information:

AccessLicenseNumber, Username, and Password. Adding the transId and transactionSrc headers renders the same response.

No matter which tracking number is sent in the GET request, the testing API returns the same response. I've tried this in python using requests and with Postman. The live API is working fine, but I need response data for specific cases, such as failed delivery attempts, similar to this SO question about the UPS SOAP API.


Solution

  • According to UPS API support, returning the same response for their testing/sandbox environment is the intended behavior.

    My question to UPS support

    (I attached the HTTP response from the question)

    When sending GET requests to the CIE url, it returns the same response (attached) no matter which tracking number is used. For example, these GET requests urls return the same response:

    https://wwwcie.ups.com/track/v1/details/1Z5338FF0107231059
    https://wwwcie.ups.com/track/v1/details/572254454
    

    These tracking numbers are from the Tracking RESTful Developer Guide.pdf. Requests to the production url work, and I'm using the same request headers for the CIE url. Am I missing something?

    UPS API support's reply

    The API is working as expected. The Response file will provide the same information even if other example tracking numbers are used.

    Conclusion

    This design choice is confusing and I'm unsure why UPS does not provide a helpful sandbox for its REST API like FedEx does with its mock tracking numbers. And it's unclear why they bother listing example tracking numbers in their REST tracking developer guide.

    The best solution seems to be finding live tracking number examples, which is difficult for developers who do not ship UPS packages.