PHP Fedex API Get Detailed Track Information

July 11th, 2019





Fedex tracking info returned after enabling detailed scans.

Since FedEx unfortunately still uses SOAP API’s for tracking, I had to delve in deep for this one.

My task was to be able to get the pickup status of a package in order to confirm Fedex’s possession of a package.

Using a simple TrackRequest was only returning the most recent event in the TrackReply, which in my case was the “delivered” event type.

Looking deeper, and with a few calls and chats with FedEx support, I realized that I need to send the ProcessingOption field through the SOAP request.

I was using Jeremy Dunn’s php-fedex-api-wrapper, so this was more straight forward than I thought and the line of code below accomplishes just that.

$trackRequest->setProcessingOptions([SimpleType\TrackRequestProcessingOptionType::_INCLUDE_DETAILED_SCANS]);

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *