USPS
Returns Label API
USPS
Web Tools™
Application
Programming Interface
User
Guide
Version 1.11 (07/25/2024)
Table of Contents
3.0 Appendix
A – Image Parameter Options
4.0 Appendix
B – Label Samples
4.1 USPS Returns Label Sample – Priority Mail Return
4.2 USPS Returns Label Sample – Priority Mail Express
Return
4.3 USPS Returns Label Sample – Ground Advantage Return
This document contains a Reference Guide to the USPS Returns Label API. 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 - an error will return if values passed exceed these limits. Where a parsing expression or character limit is not documented for tags defined as a String, 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. We recommend integrators check the character length of all values passed in the API request to avoid any truncation or unsuccessful responses.
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 information on registering and getting started with Web Tools, please refer to the Step-By-Step guide found on the Web Tools Technical Documentation Page.
Note: The Web Tools user ID (i.e.“123ABCD456”) you receive upon registration will not work at kiuknp.xyhlw.net (also reference: http://reg.xyhlw.net); USPS Web Tools API user ID credentials are separate and required for API use.
Additional
onboarding is required before integrators can begin using the Web Tools USPSReturnsLabel API to generate USPS Return labels.
Integrators should contact the USPS Mailing & Shipping Solutions Center
(MSSC) at 1-877-672-0007 for assistance. Business hours for the MSSC are
Monday-Friday from 7:00 AM-7:00 PM Central. The USPS Returns web page can also
be referenced: http://kiuknp.xyhlw.net/business/return-services.htm
Note: All Label APIs handle a pipe special character (“|”) as a space. Integrators are recommended to not include a pipe special character (“|”) in the API request. If a pipe is provided in the API request, Web Tools will treat as a space where applicable in the API XML response, label image, Shipping Partner Event File, and Shipping Services File.
Note: All Label APIs can accept a trademark symbol (“™”) in the XML request but any response from the API will strip the symbol from the text (e.g., Firm Name) and will not display the symbol on the printed labels.
The Web Tools USPS
Returns Label API enables customers to receive USPS Return labels which are
processed using the new automated return process via Package Platform. USPS
Return account holders will pay postage and fees through an Enterprise Payment
System (EPS) account so that items can be returned by their customers (at no
charge to their customers) using merchant provided USPS Return labels. The API
allows integrators to request USPS Return labels for items that can be mailed
using Priority Mail Return, Ground Return, and Priority Mail Express Return.
For additional USPS Return details, reference: http://www.federalregister.gov/documents/2020/02/25/2020-03170/usps-returns-service.
Initial
onboarding will include:
Part I: Technical Integration Specialist
(TIS)
·
Package Platform enrollment
·
USPS Returns enrollment
·
EPS account enrollment for
electronic funds transfer for payment of USPS Return postage.
·
USPS Web Tools API registration
resulting in generation of Web Tools user ID and access configuration
·
Mailer ID (MID) enrollment
·
Customer Registration ID (CRID)
enrollment
·
Configuration of Destination
Delivery Address (where applicable)
Customer Types:
The USPS Returns
Label API will support the following configuration options determined during
initial customer onboarding:
·
Non-manifesting (SSF) Option: Supports creation of return labels to a
single delivery destination address configured per Web Tools UserID. Unique ZIP4 for returns supported. Note: The
ability to generate return labels to multiple delivery destinations requires
separate Web Tools UserIDs for each destination
address.
·
Manifesting (SSF) Option (not eFulfillment):
Supports creation of return labels to a configured delivery destination address
with options for Insurance extra services. Unique ZIP4 for returns supported. A
Shipping Services File will be submitted by Web Tools for return labels on
behalf of the integrator.
·
Manifesting (SSF) eFulfillment
for Returns Option:
Supports creation of return labels for eFulfillment
returns customers to a delivery destination address collected in the API
request with options for Insurance extra services. A Shipping Services File
will be submitted by Web Tools for return labels on behalf of the integrator. Note:
The USPSReturnsLabel API will AMS-validate the
destination addresses provided by eFulFillment
customers or an error will return. Unique ZIP4s are not applicable to these
customers.
USPS Returns Label API Feature |
Non-manifesting Option |
Manifesting Option (not eFulfillment) |
Manifesting Option (eFulfillment) |
USPS Returns: |
- |
- |
- |
·
PRIORITY MAIL RETURN |
Available |
Available |
Available |
·
PRIORITY MAIL EXPRESS RETURN |
Available |
Available |
Available |
·
GROUND ADVANTAGE RETURN |
Available |
Available |
Available |
Extra Services: |
- |
- |
- |
·
Insurance |
N/A |
Available |
Available |
·
HAZMAT Extra Services |
Available |
Available |
Available |
Ability to use
multiple delivery destination addresses per Web Tools UserID.
(Address collected in XML request and submitted in fSSF) |
N/A |
N/A |
Available |
Ability to
specify Customer Reference Number(s) on label |
Available |
Available |
Available |
Ability to
specify attention line on label for Delivery Destination Address |
Available |
Available |
Available |
Support Puerto
Rican Origin Addresses |
Available |
Available |
Available |
Support Priority
Mail Cubic Return Pricing |
TBD |
TBD |
TBD |
Label
Sizes/types: |
- |
- |
- |
Default (6x4
label and receipt printed on same 8.5x11 page) Enumeration: “6X4 PAGE” |
Available |
Available |
Available |
·
ZPL (203 and 300 dpi) Enumerations:
“4X6ZPL203DPI” and “4X6ZPL300DPI” |
Available |
Available |
|
·
True 4x6 portrait Enumeration:
“4X6” |
Available |
Available |
Available |
·
True 6x4 landscape Enumeration:
“6X4” |
Available |
Available |
Available |
·
True 4x4 (restricted) |
TBD |
TBD |
TBD |
USPS Tracking
Email |
Available |
Available |
Available |
USPS Tracking
Email with PDF return label attachment |
Available |
Available |
Available |
Support unique
Returns ZIP4 |
Available |
Available |
N/A |
Generate
Shipping Services File |
N/A |
Available |
Available |
Label volume
reporting |
Available |
Available |
Available |
2D IMpb Barcode |
Available |
Available |
Available |
Optional Fees
and Attributes (i.e., dim wt.) Breakdown |
Available |
Available |
Available |
Scheme |
Host |
Path |
API |
XML |
http:// |
secure.shippingapis.com |
/ShippingAPI.dll? |
API=USPSReturnsLabel |
&XML= (see below) |
http:// |
secure.shippingapis.com |
/ShippingAPI.dll? |
API=USPSReturnsLabelCertify |
&XML= (see below) |
Note: The “USPSReturnsLabelCertify” API is for testing purposes and will not generate usable labels and barcodes.
Tag Name |
Occurs |
Description |
Type |
Validation |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest |
Required |
Used with API=USPSReturnsLabel |
(Alias) |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / USERID |
Required |
This attribute specifies your Web Tools user ID. See the Developer's Guide for information on obtaining your USERID. For Example: USERID="XXXXXXX" |
NMTOKEN |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest /
PASSWORD |
Required |
This attribute specifies your Web Tools password. See the Developer's Guide for information on your Password. For Example: PASSWORD="XXXXXXX" |
NMTOKEN |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Option |
Optional |
For future use. |
String |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Revision |
Optional |
Used to indicate API version. Use a value of “2” to return a shortened
IMpb barcode in the <TrackingNumber>
tag. For example: |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / ImageParameters |
Required |
Group containing all request parameters pertaining to the Label Image
generation. |
(Group) |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / ImageParameters / ImageType |
Required |
Label Image Type. See Appendix A for Image
parameter options. For example: <ImageType>PDFImageType> |
String |
Enumeration= · PDF · TIF · NONE · ZPL |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Optional |
Returns alternate label image. See Appendix A for Image parameter options. For example:
<ImageParameter>4X6ImageParameter> |
String |
Default=6X4PAGE Enumerations= · 4X6 · 6X4 · 6X4PAGE · 4X6ZPL203DPI · 4X6ZPL300DPI · SEPARATERECEIPTPAGE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerFirstName |
Conditionally required (only if CustomerFirm
not provided) |
First Name of customer returning package. Printed on label and
receipt. Either <CustomerFirstName> and <CustomerLastName> OR <CustomerFirm> required.
Minimum of 1 character required. Note: <CustomerFirstName> and <CustomerLastName> values have a combined 32-character
limit when printed on label. Combined values exceeding 32 characters will be
truncated due to space limitations on the label. API request eligible to
accept up to 50 characters. |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerLastName |
Conditionally required (only if CustomerFirm
not provided) |
Last Name of customer returning package. Printed on label and receipt. Either <CustomerFirstName> and <CustomerLastName> OR <CustomerFirm> required.
Minimum of 1 character required. Note: <CustomerFirstName> and <CustomerLastName> values have a combined 32-character
limit when printed on label. Combined values exceeding 32 characters will be truncated
due to space limitations on the label. API request eligible to accept up to
50 characters. |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerFirm |
Conditionally required (only if Customer First/Last Name not provided) |
Firm Name of customer returning package. Printed on label and receipt.
Either <CustomerFirstName> and <CustomerLastName> OR <CustomerFirm> required.
Minimum of 1 character required. Note: <CustomerFirm> has a 32-character
limit when printed on label. Values exceeding 32 characters will be truncated
due to space limitations on the label. API request eligible to accept up to
50 characters. |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest /
CustomerAddress1 |
Conditionally required (if address needs secondary info) |
Secondary address unit designator and number (such as an apartment or
suite number). For example: “APT 202” or “STE 100” etc. Note: This tag must be included in the request, even if the value is null,
to return a successful response. For addresses that do not require secondary
information, integrators should include “ |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest /
CustomerAddress2 |
Required |
Address of customer returning the package. (Primary Street address).
For example: |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Conditionally required
(if address is in Puerto Rico) |
Urbanization of
customer returning the package. |
String |
minLength=0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerCity |
Required |
City of customer returning the package. |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerState |
Required |
State of customer returning the package. Value should be passed as
two-letter state abbreviation. For example: <CustomerState>DCCustomerState> |
String |
pattern=\w{2} minLength=2 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerZip5 |
Required |
ZIP Code of customer returning the package. |
String |
pattern=\d{5} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerZip4 |
Optional |
ZIP+4 Code of customer returning the package. |
String |
pattern=\d{4} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / POZipCode |
Conditionally required (if mail entry ZIP Code different than
CustomerZip5) |
ZIP Code of
Post Office or collection box where item is mailed. May be different than
CustomerZip5. This tag will take precedence over CustomerZip5 when provided. Will
be used to populate the SSFv2.0 H1 pos. 7 Entry Facility ZIP Code field. For example: <POZipCode>20770 POZipCode> |
String |
pattern=\d{5} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / AllowNonCleansedOriginAddr |
Optional |
Allows Non-Validated Origin Street Address. Enter “true” to bypass street
address validation failures/errors or “false” if only validated addresses
should be allowed. Note: Integrators are recommended to always use “false” to ensure no
delivery issues. In the event USPS cannot validate the street address, this
tag will “bypass” address validation error when “true” is indicated to allow
label creation which could impact delivery. The <AllowNonCleansedOriginAddr>
excludes City, State, and ZIP Code which must be valid for a successful
response. Reference http://pe.xyhlw.net/text/pub28/28c2_001.htm. |
Boolean |
Default=false Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Optional (May be
specified when <ReturnsPostageType>=5) |
Attention line
for Retailer Address. If supplied,
this optional value will override the value stored in the Retailers WebTools
Profile. Note: <RetailerATTN>
has a 32-character limit when printed on label. Values exceeding 32
characters will be truncated due to space limitations on the label. API
request eligible to accept up to 50 characters. |
String |
minLength=0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Conditionally required
(When <ReturnsPostageType>=5) |
Firm Name of Retailer
Address for return package. Printed on label and receipt. <RetailerFirm> is required for eFulfillment
customers using <ReturnsPostageType>=5.
Minimum of 1 character required. Note: <CustomerFirm>
has a 32-character limit when printed on label. Values exceeding 32
characters will be truncated due to space limitations on the label. API
request eligible to accept up to 50 characters. |
String |
minLength=0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerAddress1 |
Optional (May be
specified when <ReturnsPostageType>=5) |
Secondary
address unit designator and number (such as an apartment or suite number).
For example: “APT 202” or “STE 100” etc. Note: |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerAddress2 |
Conditionally required
(When <ReturnsPostageType>=5) |
Address of Retailer
where the package will be returned. (Primary Street address). For example: Note: |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerCity |
Conditionally required
(When <ReturnsPostageType>=5) |
City of Retailer
where the package will be returned. Note: |
String |
minLength=1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerState |
Conditionally required
(When <ReturnsPostageType>=5) |
State of Retailer
where the package will be returned. Value should be passed as two-letter
state abbreviation. For example: <RetailerState
>DC RetailerState > Note: <RetailerState>
is required for eFulfillment customers using <ReturnsPostageType>=5. |
String |
pattern=\w{2} minLength=2 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerZip5 |
Conditionally required
(When <ReturnsPostageType>=5) |
ZIP Code of Retailer
where the package will be returned. Note: |
String |
pattern=\d{5} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerZip4 |
Conditionally required
(When <ReturnsPostageType>=5) |
ZIP+4 Code of Retailer
where the package will be returned. Note: |
String |
pattern=\d{4} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerEmail |
Conditionally required
(When <ReturnsPostageType>=5) |
Email for
Retailer of the return package. Note: Either <RetailerEmail>
OR <RetailerPhone> is required for eFulfillment customers using <ReturnsPostageType>=5. |
String |
pattern=([\w\-\.]+)@(([\w-]+\.)+)[a-zA-Z]{2,4} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RetailerPhone |
Conditionally required
(When <ReturnsPostageType>=5) |
Phone number for
Retailer of the return package. Note: Either <RetailerEmail>
OR <RetailerPhone> is required for eFulfillment customers using <ReturnsPostageType>=5. |
String |
pattern= \s*|[0-9]{10})? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / WeightInOunces |
Optional |
Package weight used to calculate postage. Items must weigh 70 pounds
(1120 ounces) or less. For example: <WeightInOunces>80 WeightInOunces> Note: If weight not supplied, 4oz used. |
Integer |
Default=4 minInclusive=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / ServiceType |
Required |
Enter one of the valid Mail Service entries: “PRIORITY” for Priority
Mail Return. “EXPRESS” for Priority Mail Express Return. “GROUND” for Ground
Advantage Return. |
String |
Enumeration= · PRIORITY · EXPRESS · GROUND |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Conditionally required
(Required for eFulfillment users) |
The Postage Type
for the Return label. Note: Required for USPSReturnsLabel
callers registered as eFulfillment users. Non-eFulfillment users may omit this tag or supply it with an
empty value. |
String |
Enumeration= · 5 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Width |
Optional |
Value must be numeric. Units are inches. Note: If partial dimensions are provided, an
error response will return. Length, Width, Height are required for accurate
pricing of a rectangular package when any dimension of the item exceeds 12
inches. In addition, Girth is required only for a non-rectangular package in
addition to Length, Width, Height when any dimension of the package exceeds
12 inches. For rectangular packages, the Girth dimension must be left blank
as this dimension is to only be used for non-rectangular packages. For
details on dimensional weight pricing, please reference the Domestic Mail
Manual Section 123.1.4 for Retail Mail and Section 223.1.6 for Commercial
Mail. http://pe.xyhlw.net/text/dmm300/index.htm |
Decimal |
minExclusive=0.0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Length |
Optional |
Value must be numeric. Units are inches. Length should be longest
dimension when compared to Width and Height values supplied. For example: Note: If partial dimensions are provided, an
error response will return. Length, Width, Height are required for accurate
pricing of a rectangular package when any dimension of the item exceeds 12
inches. In addition, Girth is required only for a non-rectangular package in
addition to Length, Width, Height when any dimension of the package exceeds
12 inches. For rectangular packages, the Girth dimension must be left blank
as this dimension is to only be used for non-rectangular packages. For
details on dimensional weight pricing, please reference the Domestic Mail
Manual Section 123.1.4 for Retail Mail and Section 223.1.6 for Commercial
Mail. http://pe.xyhlw.net/text/dmm300/index.htm |
Decimal |
minExclusive=0.0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Height |
Optional |
Value must be numeric. Units are inches. Note: If partial dimensions are provided, an
error response will return. Length, Width, Height are required for accurate
pricing of a rectangular package when any dimension of the item exceeds 12
inches. In addition, Girth is required only for a non-rectangular package in
addition to Length, Width, Height when any dimension of the package exceeds
12 inches. For rectangular packages, the Girth dimension must be left blank
as this dimension is to only be used for non-rectangular packages. For
details on dimensional weight pricing, please reference the Domestic Mail
Manual Section 123.1.4 for Retail Mail and Section 223.1.6 for Commercial
Mail. http://pe.xyhlw.net/text/dmm300/index.htm |
Decimal |
minExclusive=0.0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Girth |
Conditionally required (if package is non-rectangular) |
Note: Girth is required only for a non-rectangular package. For rectangular
packages, girth must be left blank. Value must be numeric. Units are inches. Girth is distance around the thickest part of package (perpendicular
to the length). For details on dimensional weight pricing, please reference
the Domestic Mail Manual Section 123.1.4 for Retail Mail and Section 223.1.6
for Commercial Mail http://pe.xyhlw.net/text/dmm300/index.htm. For example: Note: If partial dimensions are provided,
an error response will return. (i.e. Length, Width, and Height must all
be supplied with Girth). |
Decimal |
minExclusive=0.0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / Machinable |
Optional |
Machinable parcels are defined as parcels less than or equal to
15”x18”x22” inches and less than or equal 25 pounds. Any parcel that exceeds
either threshold (dimensions or weight) will be considered nonmachinable. Note: The API will validate provided dimensions and/or weight to
determine machinability. In this case the For example: |
Boolean |
Default=true Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Optional |
|
String |
minLength=0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / VendorProductVersionNumber |
Optional |
|
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / MailOwnerMID |
Optional |
|
String |
minLength =0 maxLength =9 pattern =\d{9} pattern =\d{6} pattern =\d{0} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerRefNo |
Optional |
Used to collect
RMA number. The <CustomerRefNo> value will be used to populate the
SSFv2.0 D1 pos. 21 Customer Reference Number field. |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / PrintCustomerRefNo |
Optional |
Used to print <CustomerRefNo> value on the label. The <PrintCustomerRefNo> must be set to “true” in order to display <CustomerRefNo>
on the label. |
Boolean |
Default=false Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / CustomerRefNo2 |
Conditionally required
(When <ReturnsPostageType>=5) |
Used to collect
merchant ID. Note: |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / PrintCustomerRefNo2 |
Optional |
Used to print
|
Boolean |
Default=false Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / SenderName |
Optional |
Used for the USPS Tracking email. Indicates the name of the person or
company sending the USPS tracking email notification. Note: No email is returned when generating a Sample (i.e., API=USPSReturnsLabelCertify) request. |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Optional |
Used for the
USPS Tracking email. Indicates the email address of sender used for USPS
tracking email notification. Valid email addresses must be used. Note: <RecipientEmail>
must be populated to generate USPS tracking email notification. If <SenderEmail> provided without <RecipientEmail>,
USPS tracking email notification will not be generated. Note: No email is returned when generating a Sample (i.e.,
API=USPSReturnsLabelCertify) request. |
String |
pattern=([\w\-\.]+)@(([\w-]+\.)+)[a-zA-Z]{2,4} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RecipientName |
Optional |
Used for the
USPS Tracking email. Indicates the name of the person or company receiving
the USPS tracking email notification. If recipient name not provided, email
will be addressed to <RecipientEmail> value
provided. Note: No email is returned when generating a Sample (i.e.,
API=USPSReturnsLabelCertify) request. |
String |
minLength=0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / RecipientEmail |
Optional |
Required to
generate the USPS Tracking email. Indicates email address of recipient receiving
the USPS tracking email notification. Valid email addresses must be used. Note: No email is returned when generating a Sample (i.e.,
API=USPSReturnsLabelCertify) request. |
String |
pattern=([\w\-\.]+)@(([\w-]+\.)+)[a-zA-Z]{2,4} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / TrackingEmailPDF |
Optional |
Used to indicate
if a PDF return label will be attached (true) or not (false) to the USPS
Tracking email. |
Boolean |
Default=false Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / ExtraServices |
Optional |
Groups extra services elements |
(Group) |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Optional,
repeating up to unbounded times |
Use to specify
extra services. If no Extra Service is specified, USPS Tracking will be the
default, base service. Currently
available services are:
Note: When <ExtraService>=“125” and <InsuredAmount> is less than or equal to $100, the insurance price returned will be zero (“$0.00”) to reflect baked-in insurance. If <InsuredAmount> is greater than $100, the insurance price returned will reflect an extra cost since baked-in insurance was exceeded. |
String |
whiteSpace=collapse Enumeration= · 100 · 101 · 125 HAZMAT Services: · 810 · 811 · 812 · 813 · 814 · 815 · 816 · 817 · 818 · 819 · 820 · 821 · 822 · 823 · 824 · 825 · 826 · 827 · 828 · 829 · 830 · 831 ·
832 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Conditionally required
(When insurance extra service is also
indicated) |
Use this tag for entering an insurance
amount, if applicable. For example: <InsuredAmount>100.00InsuredAmount> Note: The maximum insurance available may vary by the
Return Mail Service type requested. |
Decimal |
minInclusive=0.0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / WaiverOfSignature |
Optional |
No Signature
Required for Delivery. Enter “true” if you do not want a signature for
receipt of the package or “false” if you do. For example:
<WaiverOfSignature>trueWaiverOfSignature> |
Boolean |
Default=false Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest /ReturnFees |
Optional |
This tag must be
set to “true” for |
Boolean |
Default=false Enumerations= · true · false |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / OriginalTrackingNumber |
Optional |
Collects the original tracking number
(i.e., IMpb) over labeled on the package. Value
must be numeric and correspond to defined IMpb
barcode lengths per USPS Pub 199. |
String |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest / OriginalTrackingNumberConstruct |
Optional |
Barcode construct code for <OriginalTrackingNumber>. Value must be valid
3-character IMpb barcode construct defined in USPS Pub 199 Appendix J Table 1. For Example:
|
String |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
USPSReturnsLabelRequest |
Required |
Used with API=USPSReturnsLabel |
(Alias) |
|
Non-manifesting (SSF) XML Request: <USPSReturnsLabelRequest USERID="XXXXXXXXX" PASSWORD="XXXXXXXXX"> <ImageParameters> <ImageType>PDFImageType> ImageParameters> <CustomerFirstName>Cust First NameCustomerFirstName> <CustomerLastName>Cust Last NameCustomerLastName> <CustomerFirm>Customer FirmCustomerFirm> <CustomerUrbanization/> <CustomerCity>WashingtonCustomerCity> <CustomerState>DCCustomerState> <POZipCode>20260POZipCode> <AllowNonCleansedOriginAddr>falseAllowNonCleansedOriginAddr> <RetailerATTN>ATTN: Retailer Returns DepartmentRetailerATTN> <RetailerFirm>Retailer FirmRetailerFirm> <WeightInOunces>80WeightInOunces> <ServiceType>PRIORITYServiceType> <CustomerRefNo>RMA%23: EE66GG87CustomerRefNo> <PrintCustomerRefNo>truePrintCustomerRefNo> <SenderName>Sender Name for EmailSenderName> <SenderEmail>senderemail@email.comSenderEmail> <RecipientName>Recipient of EmailRecipientName> <RecipientEmail>recipientemail@email.comRecipientEmail> <TrackingEmailPDF>trueTrackingEmailPDF> <ExtraServices> <ExtraService>ExtraService> ExtraServices> USPSReturnsLabelRequest> Manifesting (SSF) XML Request: <USPSReturnsLabelRequest USERID="XXXXXXXXX" PASSWORD="XXXXXXXXX"> <ImageParameters> <ImageType>PDFImageType> <ImageParameter>4X6ImageParameter> <ImageParameter>SEPARATERECEIPTPAGEImageParameter> ImageParameters> <CustomerFirstName>Cust First NameCustomerFirstName> <CustomerLastName>Cust Last NameCustomerLastName> <CustomerFirm>Customer FirmCustomerFirm> <CustomerUrbanization>URB REPTO VETERANOCustomerUrbanization> <CustomerCity>San JuanCustomerCity> <CustomerState>PRCustomerState> <POZipCode>20260POZipCode> <AllowNonCleansedOriginAddr>trueAllowNonCleansedOriginAddr> <RetailerATTN>ATTN: Retailer Returns DepartmentRetailerATTN> <RetailerFirm>Retailer FirmRetailerFirm> <WeightInOunces>10WeightInOunces> <ServiceType>EXPRESSServiceType> <CustomerRefNo>RMA%23: EE66GG87CustomerRefNo> <PrintCustomerRefNo>truePrintCustomerRefNo> <SenderName>Sender Name for EmailSenderName> <SenderEmail>senderemail@email.comSenderEmail> <RecipientName>Recipient of EmailRecipientName> <RecipientEmail>recipientemail@email.comRecipientEmail> <TrackingEmailPDF>trueTrackingEmailPDF> <ExtraServices> <ExtraService>101ExtraService> ExtraServices> <InsuredAmount>100InsuredAmount> <WaiverOfSignature>trueWaiverOfSignature> USPSReturnsLabelRequest> Manifesting (SSF) eFulfillment
for Return XML Request: <USPSReturnsLabelRequest USERID="XXXXXXXXX" PASSWORD="XXXXXXXXX"> <ImageParameters> <ImageType>PDFImageType> <ImageParameter>6X4PAGEImageParameter> ImageParameters> <CustomerFirstName>Cust First NameCustomerFirstName> <CustomerLastName>Cust Last NameCustomerLastName> <CustomerFirm>Customer FirmCustomerFirm> <CustomerUrbanization/> <CustomerCity>WashingtonCustomerCity> <CustomerState>DCCustomerState> <POZipCode>20260POZipCode> <AllowNonCleansedOriginAddr>trueAllowNonCleansedOriginAddr> <RetailerATTN>ATTN: Retailer Returns DepartmentRetailerATTN> <RetailerFirm>Retailer FirmRetailerFirm> <RetailerState>DCRetailerState> <RetailerEmail>Returns@Retailer.comRetailerEmail> <RetailerPhone>2125551234RetailerPhone> <WeightInOunces>10WeightInOunces> <ServiceType>GROUNDServiceType> <ReturnsPostageType>5ReturnsPostageType> <VendorCode>1000VendorCode> <MailOwnerMID>817463MailOwnerMID> <CustomerRefNo>RMA%23: EE66GG87CustomerRefNo> <PrintCustomerRefNo>truePrintCustomerRefNo> <SenderName>Sender Name for EmailSenderName> <SenderEmail>senderemail@email.comSenderEmail> <RecipientName>Recipient of EmailRecipientName> <RecipientEmail>recipientemail@email.comRecipientEmail> <TrackingEmailPDF>trueTrackingEmailPDF> <ExtraServices> <ExtraService>100ExtraService> ExtraServices> <InsuredAmount>100InsuredAmount> <ReturnFees>trueReturnFees> USPSReturnsLabelRequest> |
Tag Name |
Occurs |
Description |
Type |
Validation |
||||||||
Required |
|
(Alias) |
|
|||||||||
USPSReturnsLabelResponse /
BarcodeNumber |
Required |
Tracking / Confirmation number for the
package. This tag returns a long form IMpb that
includes routing information: 42020904198592019xxxxxxxxxxxxxxxxx |
String |
|
||||||||
USPSReturnsLabelResponse /
TrackingNumber |
Required |
Tracking / Confirmation number for the
package. This tag returns a shortened IMpb that
begins with the Channel Application ID: 92019xxxxxxxxxxxxxxxxx TrackingNumber
is available when |
String |
|
||||||||
USPSReturnsLabelResponse / LabelImage |
Optional |
Binary representation of the label in the form selected (PDF, TIF). Default response will contain a single <LabelImage> tag containing label and receipt on the same page. Note: Not returned when <ImageType>=“NONE” is specified in request. |
base64Binary |
Default= <LabelImage> contains label and receipt on same page |
||||||||
USPSReturnsLabelResponse / ReceiptImage |
Optional |
Binary representation of the Receipt in the form selected (PDF, TIF). Note: Only returned when SEPARATERECEIPTPAGE is specified in the request. |
base64Binary |
|
||||||||
USPSReturnsLabelResponse / RetailerATTN |
Optional |
Attention line
of Retailer receiving the return package. |
String |
maxLength=50 |
||||||||
USPSReturnsLabelResponse / RetailerFirm |
Optional |
Firm Name of
Retailer receiving the return package. Configured “Delivery Destination
Company” used. Future enhancements will also use <RetailerFirm>. Note: <RetailerFirm> value truncated after 32-characters when printed on label due to space limitations. API response eligible to return up to 50 characters. |
String |
MaxLength=50 |
||||||||
USPSReturnsLabelResponse / RetailerAddress1 |
Optional |
Address of Retailer receiving the return package. Secondary address unit designator and number (such as an apartment or suite number). For example: “APT 202” or “STE 100” etc. Configured “Delivery Destination Address2” used. |
String |
|
||||||||
USPSReturnsLabelResponse / RetailerAddress2 |
Required |
Address of Retailer receiving the return package. Configured “Delivery Destination Address” used. |
String |
|
||||||||
USPSReturnsLabelResponse / RetailerCity |
Required |
City of Retailer receiving the return package. Configured “Delivery Destination City” used. |
String |
|
||||||||
USPSReturnsLabelResponse / |
Required |
State of Retailer receiving the return package. Configured “Delivery Destination State” used. |
String |
|
||||||||
USPSReturnsLabelResponse / RetailerZip5 |
Required |
Zip5 of Retailer receiving the return package. Configured “Delivery Destination Zip Code” used. |
String |
pattern=\d{5} |
||||||||
USPSReturnsLabelResponse / RetailerZip4 |
Required |
Zip4 of Retailer receiving the return package. Configured “Delivery Destination Zip Code” used. |
String |
|
||||||||
USPSReturnsLabelResponse / RDC |
Required |
Retail Distribution Code printed on label for USPS processing purposes. Note: The following MCSetCodes are used by USPSReturnsLabel API to determine RDC:
|
String |
|
||||||||
USPSReturnsLabelResponse / Postage |
Required |
Postage amount
for the return package. Note: Does not include any extra service fees or
surcharges. |
String |
minLength=0 |
||||||||
USPSReturnsLabelResponse / ExtraServices |
Optional |
Groups extra
service information specified in request. |
(Group) |
|
||||||||
USPSReturnsLabelResponse / ExtraServices / ExtraService |
Optional,
repeating up to unbounded times |
Groups extra
service information specified in request. |
(Group) |
|
||||||||
USPSReturnsLabelResponse / ExtraServices / ExtraService
/ ServiceID |
Optional |
Extra Service ID
included in request |
String |
|
||||||||
USPSReturnsLabelResponse / ExtraServices / ExtraService
/ ServiceName |
Optional |
Extra Service
name |
String |
|
||||||||
USPSReturnsLabelResponse / ExtraServices / ExtraService
/ Price |
Optional |
Extra Service
fee |
Decimal |
|
||||||||
USPSReturnsLabelResponse / Zone |
Required |
Postal Zone. USPS defined distance codes assigned to each origin and
destination ZIP Code pairing for every ZIP Code number in the nation. These
distance codes, referred to as zones, are designated as “1 through 9." |
String |
|
||||||||
USPSReturnsLabelResponse / DimensionalWeight |
Optional |
Dimensional
Weight of package used to determine postage. Postage based on actual weight (specified
in <WeightInOunces>) or the dimensional
weight, whichever is greater. For example, <DimensionalWeight>14.0DimensionalWeight> For details on
dimensional weight pricing, please reference the Domestic Mail Manual Section
123.1.4 for Retail Mail and Section 223.1.6 for Commercial Mail. http://pe.xyhlw.net/text/dmm300/index.htm |
String |
|
||||||||
USPSReturnsLabelResponse / CarrierRoute |
Required |
Carrier Route |
String |
|
||||||||
USPSReturnsLabelResponse / LogMessage |
Optional |
Messaging for
integrators of this API. It may contain additional information about this
particular request / response, or general information about the API or Web
Tools. In typical implementations, whenever this tag is encountered, the
message is written to the console log file for later analysis. |
String |
|
||||||||
USPSReturnsLabelResponse / Fees |
Optional |
Returned when
“Fees” is True Dimensional
weight pricing will include length and volume fees to account for cost of
processing oversized parcels |
|
|
||||||||
USPSReturnsLabelResponse / Fee |
Required |
|
String |
|
||||||||
USPSReturnsLabelResponse / Fee / FeeType |
Required |
Indicates what type of Fee is being
requested: -
Non Standard Length
Fee(s) -
Non Standard Volume Fee(s) -
Live Animal Transportation Fee(s) |
String |
|
||||||||
USPSReturnsLabelResponse / Fee / FeeType / FeePrice
|
Required |
Fee price. See Notice 123
for fee applicability and pricing. |
String |
|
||||||||
USPSReturnsLabelResponse / Fees / Fee / FeeType / FeePrice / FeeInformation |
Required |
Fee Information
indicates the fee is |
String |
|
||||||||
USPSReturnsLabelResponse / Fees / Fee / FeeType / FeePrice / FeeInformation / FeeInfo FeeInfoType=”PriceType” |
Required |
Fee Information indicates the fee is |
String |
|
||||||||
USPSReturnsLabelResponse / Attributes |
Required |
When <ReturnFees>
= True, the new Attributes tag will return to show Oversize fees and/or
Dimensional Weight fees. Any future package attributes that impact a price
returned will be included in the attributes tag. |
String |
|
||||||||
USPSReturnsLabelResponse / Attributes / AttributeKey |
Required |
Attribute Key: ·
DimensionalWeightR = RetailRate ·
DimensionalWeightCB = Commercial Rate ·
DimensionalWeightCP = Commerical Plus Rate ·
Oversized |
String |
|
||||||||
USPSReturnsLabelResponse |
Required |
|
(Alias) |
|
XML Response: <USPSReturnsLabelCertifyResponse>
<TrackingNumber>925989XXXXXXXXXXXXXXXXTrackingNumber> <LabelImage>---
Base 64 Binary stream Suppressed for documentation---LabelImage> <RetailerATTN>ATTN:
Retailer Returns DepartmentRetailerATTN> <RetailerFirm>RETAILER
FIRMRetailerFirm>
<RetailerState>DCRetailerState>
<ExtraServices> <ExtraService> <ServiceID>100ServiceID> <ServiceName>InsuranceServiceName>
ExtraService> ExtraServices> <DimensionalWeight>28DimensionalWeight> <CarrierRoute>C000CarrierRoute> <FeeType>Nonstandard Length fee > 22 in.FeeType> <FeePrice>4.00FeePrice> <FeeType>Nonstandard Volume fee > 2 cu. ft.FeeType> <FeePrice>15.00FeePrice> USPSReturnsLabelCertifyResponse> |
Image Parameter(s) |
Description |
Receipt |
Image Type |
6X4 PAGE |
1 image returned: Full Page 8.5x11 with 6x4 label and receipt (current
default). |
Yes, included in single image |
PDF, TIF |
6X4 PAGE SEPARATERECEIPTPAGE |
2 images
returned: 1) Full Page
8.5x11 with 6x4 label 2) Receipt on Full Page 8.5x11 |
Yes, but on separate full page |
PDF, TIF |
4X6 |
1 image returned: True 4x6 |
No |
PDF, TIF |
4X6 SEPARATERECEIPTPAGE |
2 images
returned: 1) True 4x6
label 2) Receipt on Full Page 8.5x11 |
Yes, but on separate full page |
|
6X4 |
1 image returned: True 6x4 |
No |
PDF, TIF |
6X4 SEPARATERECEIPTPAGE |
2 images
returned: 1) True 6x4
label True 2) Receipt on Full Page 8.5x11 |
Yes |
PDF, TIF |
4X6ZPL203DPI |
1 image returned: 4x6 ZPL 203 |
No |
ZPL |
4X6ZPL300DPI |
1 image returned: 4x6 ZPL 300 |
No |
ZPL |
Figure 1: USPS Priority Mail Return label
Figure 2: Priority Mail Express Return label
Figure 3: USPS Ground Advantage Return label
Web Tools USPSReturnsLabel allows
a unique Returns ZIP4 which can be used instead of the ZIP4 returned from AMS
in the XML response
Context: Today local AMS generates a unique Returns destination ZIP4 for larger volume returns shippers but does not share this data outside of AMS DB with other internal systems. As a result, a unique Returns ZIP4 will fail AMS validation and standardize to the ZIP4 of the physical address. For the Web Tools USPS Returns API, a configured unique ZIP4 allows customers to bypass the AMS ZIP4.
Ex. Destination Address: “16840 BUCCANEER LN HOUSTON, TX 77058 + XX50* – the unique ZIP4 is “XX50”, AMS standardizes to “2563” – when the unique ZIP4 option is configured in Web Tools, the unique returns ZIP4 of "XX50" is used.