oneCoderToRuleThemAll
oneCoderToRuleThemAll

Reputation: 865

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.

Upvotes: 2

Views: 4942

Answers (2)

MnMProgrammer
MnMProgrammer

Reputation: 99

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

Upvotes: 1

Calvin
Calvin

Reputation: 106

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

Upvotes: 9

Related Questions