xmlweb-servicesusps

USPS Tracking API Expected Delivery Date?


I am integrating USPS tracking API into my current project and need some help getting all the tracking info. Basically, my requests are done by the following URL:

http://production.shippingapis.com/ShippingAPI.dll?API=TrackV2&XML=<TrackRequest USERID="My-ID"><TrackID ID="9400110200882198420715"></TrackID></TrackRequest>

This request(once I input my correct ID) returns a XML page containing a summary, tracking id, and package's locations, but it doesn't have any tags regarding the expected delivery date (the tracking id used has one). My question is how do I get the expected delivery info to show up on the XML? I am certain there should be a way to get that info as other companies like Amazon and eBay have a "expected delivery date" along with all the tracking info. I tried reading the USPS manual(https://www.usps.com/business/web-tools-apis/track-and-confirm.pdf) on the API but it doesn't really explain well. If anyone can make sense of it and help me out, I would be highly grateful.


Solution

  • The expected delivery date is available through "TrackFieldRequest"

    Example Request

    <TrackFieldRequest USERID="xxxxxxxx">
    <Revision>1</Revision>
    <ClientIp>127.0.0.1</ClientIp>
    <SourceId>John Doe</SourceId>
        <TrackID ID="010850921250125054">
            <DestinationZipCode>12345</DestinationZipCode>
            <MailingDate>2010-01-01</MailingDate>
       </TrackID>
    </TrackFieldRequest>
    

    Example Request Response

    <?xml version="1.0" ?>
    <TrackResponse>
         <TrackInfo ID="9102969010383081813033">
             <ExpectedDeliveryDate>March 9, 2012</ExpectedDeliveryDate>
              ...
         </TrackInfo>
    </TrackResponse>
    

    Source: https://www.usps.com/business/web-tools-apis/track-and-confirm.htm#_Toc378923168