Track and Confirm Api
Track and Confirm Api
API
USPS Web Tools™
Application Programming Interface
User Guide
Version 4.7 (10/07/2024)
USPS Web Tools User Guide
Table of Contents
1.0 Introduction .................................................................................................................................... 4
1.1 Before you get started: ................................................................................................................ 4
1.2 Tracking Service APIs ................................................................................................................. 4
2.0 Package Track API ......................................................................................................................... 5
2.1 Overview ...................................................................................................................................... 5
2.1.1 API Signature Table ................................................................................................................ 5
2.2 Request Descriptions ................................................................................................................... 6
2.2.1 Sample Request ...................................................................................................................... 6
2.3 Response Descriptions ................................................................................................................ 6
2.3.1 Sample Response ................................................................................................................... 7
3.0 Package Tracking “Fields” API .................................................................................................... 8
3.1 Overview ...................................................................................................................................... 8
3.1.1 API Signature .......................................................................................................................... 8
3.2 Request Descriptions ................................................................................................................... 8
3.2.1 Sample Request ...................................................................................................................... 9
3.2 Response Descriptions .............................................................................................................. 10
3.3.2 Sample Response ................................................................................................................. 18
4.0 Track and Confirm by Email API ................................................................................................ 21
4.1 Overview .................................................................................................................................... 21
4.1.1 API Signature ........................................................................................................................ 21
4.2 Request Descriptions ................................................................................................................. 21
4.2.1 Sample Request .................................................................................................................... 23
4.3 Response Descriptions .............................................................................................................. 23
4.3.1 Sample Response ................................................................................................................. 24
5.0 Proof of Delivery API ................................................................................................................... 24
5.1 Overview .................................................................................................................................... 24
5.1.1 API Signature ........................................................................................................................ 24
5.2 Request Descriptions ................................................................................................................. 24
5.2.1 Sample Request .................................................................................................................... 26
5.3 Response Descriptions .............................................................................................................. 27
5.3.1 Sample Response ................................................................................................................. 27
6.0 Return Receipt Electronic API .................................................................................................... 27
6.1 Overview .................................................................................................................................... 27
6.1.1 API Signature ........................................................................................................................ 27
2
USPS Web Tools User Guide
3
USPS Web Tools User Guide
1.0 Introduction
This document contains a Reference Guide to the USPS Tracking/Delivery Confirmation Label APIs. See
the Developer's Guide to learn the administrative process for gaining access to the Web Tools APIs as
well as the basic mechanism for calling the APIs and processing the results. The Developer’s Guide also
contains information on testing and troubleshooting.
Note: The Request Parameter sections present the XML input tags for generating live requests along with
the restrictions on the values allowed. An error message will be returned if an incorrect value is entered.
Also, be aware of the maximum character amounts allowed for some tags. If the user enters more than
those amounts, an error will not be generated. Web Tools will simply pass in the characters up to the
maximum amount allowed and disregard the rest. This is important since the resulting value could
prevent a correct response.
When building the XML request, pay particular attention to the order and case for tags. An error message
will be returned if an incorrect value is entered. Remember that all data and attribute values in this
document are for illustration purposes and are to be replaced by your actual values. For instance, a line
of sample code may be:
<TrackID> EJ123456780US </TrackID>
In this instance, you will replace “EJ123456780US” with the tracking ID for the package.
4
USPS Web Tools User Guide
• Mailing Address:
• Mailing City:
• Mailing State:
• Mailing Zip Code:
• Web Tools Registration Date:
• API access requested: Package Tracking (API=TrackV2)
• Anticipated volume: (daily, weekly, monthly, or annually)
• Shipping done with USPS: Please describe.
• Any additional information:
Four service APIs are offered in conjunction with “Revision=1” of the Package Tracking “Fields” API:
Track and Confirm by Email (PTSEmail), Proof of Delivery (PTSPod), Track Proof of Delivery (PTSTPod),
and Return Receipt Electronic (PTSRre). The response data from Track/Confirm Fields request
determines which services are available for a tracking ID. Each request input to the Web Tools server for
the tracking service APIs is limited to one tracking ID. These APIs require additional permissions and in
order to gain access follow the above steps.
5
USPS Web Tools User Guide
6
USPS Web Tools User Guide
7
USPS Web Tools User Guide
TrackFieldRequest Required This is for versioning of the API's and for Integer minOccurs="
/ Revision triggering response tags for future versions. 0"
In this API use a value of 1 to return all
available response tags and trigger new
functionality.
For example: <Revision>1</Revision>
8
USPS Web Tools User Guide
9
USPS Web Tools User Guide
10
USPS Web Tools User Guide
11
USPS Web Tools User Guide
12
USPS Web Tools User Guide
Populates “Expected
Delivery on” if the source of
the PDD is a PTR calculated
date.
For example: Expected
Delivery by or Expected
Delivery on
Optional States which system
TrackResponse / String
provided the Predicted
TrackInfo /
Delivery prediction.
PredictedDeliverySource
TRP, AA
Optional Predicted Delivery Window
TrackResponse / String
start time in am/pm format.
TrackInfo / PDWStart
In an EndOfDay scenario,
the PDWStart tag is null.
11:00am
For example: (null)
Optional Predicted Delivery Window
TrackResponse / String
end time in am/pm format.
TrackInfo / PDWEnd
In an EndOfDay scenario,
the PDWEnd tag is null.
1:00pm
For example: (null)
Optional Contains the Purge By Date
TrackResponse / String
of the mail piece.
TrackInfo / PurgeByDate
Example: December 31,
2024
Optional The related label ID
TrackResponse / String
between a tracking barcode,
TrackInfo / RelatedRRID
the core product, and a
PS3811, Green Card Return
Reciept. This field can
contain either the core
product label ID or the
Green Card label ID. There
is only a one to one
relationship.
Core Product ID:
EA123456795US
Or Green Card ID;
9590940112345671234567
Optional Signifies if Restore tracking Enumeration:
TrackResponse / Boolea
information service is • True
TrackInfo / n
RestoreEnabled
enabled • False
Optional Field indicating the date the
TrackResponse / String
item will be Returned to
TrackInfo /
Sender.
ReturnDateNotice
13
USPS Web Tools User Guide
14
USPS Web Tools User Guide
Conditional
TrackResponse / Tracking Summary (group)
Required
TrackInfo / Information. The group is
TrackSummary max 1 listed once.
15
USPS Web Tools User Guide
16
USPS Web Tools User Guide
17
USPS Web Tools User Guide
18
USPS Web Tools User Guide
<EventState>TX</EventState>
<EventZIPCode>79109</EventZIPCode>
<EventCountry/>
<FirmName/>
<Name>RXXXXXX XXXXXXX</Name>
<AuthorizedAgent>false</AuthorizedAgent>
<DeliveryAttributeCode/>
<GMT>14:00:00</GMT>
<GMTOffset>-05:00</GMTOffset>
</TrackSummary>
<TrackDetail>
<EventTime/>
<EventDate>June 22, 2022</EventDate>
<Event>USPS expects item for mailing (SSK)</Event>
<EventCity>LAUREL</EventCity>
<EventState>MD</EventState>
<EventZIPCode>20707</EventZIPCode>
<EventCountry/>
<FirmName/>
<Name/>
<AuthorizedAgent>false</AuthorizedAgent>
<GMT/>
<GMTOffset/>
</TrackDetail>
</TrackInfo>
</TrackResponse>
19
USPS Web Tools User Guide
<StatusSummary>Your item has been delivered to an agent at 9:00 am on June 22, 2022 in
AMARILLO, TX 79109. The item was signed for by R XXXXXXX.</StatusSummary>
<TABLECODE>T</TABLECODE>
<TrackSummary>
<EventTime>9:00 am</EventTime>
<EventDate>June 22, 2022</EventDate>
<Event>Delivered, To Agent</Event>
<EventCity>AMARILLO</EventCity>
<EventState>TX</EventState>
<EventZIPCode>79109</EventZIPCode>
<EventCountry/>
<FirmName/>
<Name>RXXXXXX XXXXXXX</Name>
<AuthorizedAgent>false</AuthorizedAgent>
<EventCode>01</EventCode>
<DeliveryAttributeCode/>
<GMT>14:00:00</GMT>
<GMTOffset>-05:00</GMTOffset>
</TrackSummary>
<TrackDetail>
<EventTime/>
<EventDate>June 22, 2022</EventDate>
<Event>USPS expects item for mailing (SSK)</Event>
<EventCity>LAUREL</EventCity>
<EventState>MD</EventState>
<EventZIPCode>20707</EventZIPCode>
<EventCountry/>
<FirmName/>
<Name/>
<AuthorizedAgent>false</AuthorizedAgent>
<EventCode>03</EventCode>
<GMT/>
<GMTOffset/>
</TrackDetail>
</TrackInfo>
</TrackResponse>
Error Response:
<TrackResponse>
<TrackInfo ID="XXXXXXXXXXXXXXXXXX">
<Error>
<Number>-2147219283</Number>
<Description>A status update is not yet available on your Priority Mail Express<SUP>®</SUP>
package. It will be available when the shipper provides an update or the package is delivered to USPS.
Check back soon. Sign up for Informed Delivery<SUP>®</SUP> to receive notifications for
packages addressed to you.</Description>
<HelpFile/>
<HelpContext/>
</Error>
</TrackInfo>
20
USPS Web Tools User Guide
21
USPS Web Tools User Guide
22
USPS Web Tools User Guide
For example:
<Email1>[email protected]</Email1
>
Request: PTSEmail
<PTSEmailRequest USERID="XXXXXXXXX" PASSWORD="">
<TrackId>XXXXXXXXXXX</TrackId >
<ClientIp>127.0.0.1</ClientIp>
<SourceId>XYZ Corp</SourceId>
<MpSuffix >9402</MpSuffix>
<MpDate >2009-07-02 00:42:23.35744</MpDate>
<RequestType>EN</RequestType>
<FirstName>John</FirstName>
<LastName >Doe</LastName>
<Email1>[email protected]</Email1>
<Email2></Email2>
<Email3></Email3>
</PTSEmailRequest>
23
USPS Web Tools User Guide
Response: PTSEmail
<PTSEMAILRESULT>
<ResultText>Your request for all activity to-date will be processed within four hours. Any future activity
will be processed whenever there is new delivery related event activity.</ResultText>
<ReturnCode>0</ReturnCode>
</PTSEMAILRESULT>
24
USPS Web Tools User Guide
PTSPodRequest Required Enter a notification request type from the String minOccurs="1"
/ RequestType choices available.
For example:
<RequestType>Email</RequestType>
25
USPS Web Tools User Guide
Request: PTSPod
<PTSPodRequest USERID="XXXXXXXXX" PASSWORD="">
<TrackId>XXXXXXXXXXX</TrackId >
<ClientIp>127.0.0.1</ClientIp>
<SourceId>XXXXXX</SourceId>
<MpSuffix>9402</MpSuffix>
<MpDate>2009-07-02 00:42:23.35744</MpDate>
<RequestType>Email</RequestType>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Email1>[email protected] </Email1>
<Email2></Email2>
<Email3></Email3>
<CustRegID>1234567890</CustRegID>
<TableCode>T</TableCode>
26
USPS Web Tools User Guide
</PTSPodRequest>
27
USPS Web Tools User Guide
28
USPS Web Tools User Guide
PTSRreResponse /
Required Status message. String
ResultText
PTSRreRequest /
Required Return code. Integer
ReturnCode
29
USPS Web Tools User Guide
30
USPS Web Tools User Guide
PTSTpodRequest Required Enter a notification request type from the String minOccurs="1"
/ RequestType choices available.
For example:
<RequestType>Email</RequestType>
31
USPS Web Tools User Guide
PTSTPODResponse
Required Status message. String
/ ResultText
PTSTpodRequest /
Required Return code. Integer
ReturnCode
32
USPS Web Tools User Guide
33