Search code examples
web-servicestrackingfedex

How to get full tracking info (Fedex Webservices)?


If I use the Fedex Tracking tool from website (https://www.fedex.com) I can see every activity with its details (like location). But, when I use Fedex Webservice, I don't get the same info. I only get detailed info for the current status, but I also need to get the details of previous statuses. In the documentation is not described a flag or something I need to add to my request to retrieve the full info as in the Fedex Website.

Here's the SOAP Envelope I send in my request.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v16="http://fedex.com/ws/track/v16">
   <soapenv:Header/>
   <soapenv:Body>
      <v16:TrackRequest>
         <v16:WebAuthenticationDetail>
            <v16:UserCredential>
               <v16:Key>XXXXXXXXXXX</v16:Key>
               <v16:Password>XXXXXXXXX</v16:Password>
            </v16:UserCredential>
         </v16:WebAuthenticationDetail>
         <v16:ClientDetail>
            <v16:AccountNumber>XXXXXXXXX</v16:AccountNumber>
            <v16:MeterNumber>XXXXXXXXXXX</v16:MeterNumber>
         </v16:ClientDetail>
         <v16:TransactionDetail>
            <v16:CustomerTransactionId>Track By Number_v16</v16:CustomerTransactionId>
            <v16:Localization>
               <v16:LanguageCode>EN</v16:LanguageCode>
               <v16:LocaleCode>US</v16:LocaleCode>
            </v16:Localization>
         </v16:TransactionDetail>
         <v16:Version>
            <v16:ServiceId>trck</v16:ServiceId>
            <v16:Major>16</v16:Major>
            <v16:Intermediate>0</v16:Intermediate>
            <v16:Minor>0</v16:Minor>
         </v16:Version>
         <v16:SelectionDetails>
            <v16:CarrierCode>FDXE</v16:CarrierCode>
            <v16:PackageIdentifier>
               <v16:Type>TRACKING_NUMBER_OR_DOORTAG</v16:Type>
               <v16:Value>783202918813</v16:Value>
            </v16:PackageIdentifier>
            <v16:PagingDetail></v16:PagingDetail>

            <v16:SecureSpodAccount/>
              <v16:Destination>
            </v16:Destination>
         </v16:SelectionDetails>
      </v16:TrackRequest>
   </soapenv:Body>
</soapenv:Envelope>

Solution

  • According to this documentation I found (page 606), you need to include a ProcessingOptions object on your TrackRequest with the value of INCLUDE_DETAILED_SCANS set to TRUE.

    If FALSE (the default), the reply will contain summary/profile data including current status.

    If TRUE, the reply will contain profile and detailed scan activity (multiple TrackDetail objects) for each package.

    That translates to

    <v16:ProcessingOptions>INCLUDE_DETAILED_SCANS</v16:ProcessingOptions>
    

    in your SOAP request.