skip to Main Content

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=

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 greatful. Thanks !

2

Answers


  1. 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

    Login or Signup to reply.
  2. Sorry for the late response, I just ran across this recently. Maybe someone out there is looking for a similar solution.

    I’m having a similar issue with estimated delivery date not being in the results. This worked for me:

    https://secure.shippingapis.com/ShippingAPI.dll?API=TrackV2&XML=
    <?xml version="1.0" encoding="UTF-8"?>
    <TrackFieldRequest USERID="XXXX">
    <Revision>1</Revision>
    <ClientIp>122.3.3</ClientIp>
    <SourceId>XYZ Corp</SourceId>
    <TrackID ID="XXXX"></TrackID>
    </TrackFieldRequest>
    

    This will provide a field called "PredictedDeliveryDate" and "OnTime" which seem very similar to their expecteddeliverydate

    Reference url: https://www.usps.com/business/web-tools-apis/track-and-confirm-api.htm

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search