USPS
Web Tools™
Application
Programming Interface
User
Guide
Version 1.5 (10/22/2021)
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 Service
4.2 USPS
Returns Label Sample – First-Class Package Return Service
4.3 USPS
Returns Label Sample – Ground Return Service
This document contains a Reference Guide to the USPS Returns Label API. See the Developers 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 www.usps.com (also reference: https://reg.usps.com); 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 Returns service 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: https://www.usps.com/business/return-services.htm
The Web Tools USPS Returns Label API enables customers to receive USPS Returns service labels which are processed using the new automated returns process via Package Platform. USPS Returns service 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 Returns service labels. The API allows integrators to request USPS Returns service labels for items that can be mailed using First-Class Package Return Service, Priority Mail Return Service, and Ground Return Service. For additional USPS Returns service details, reference: https://www.federalregister.gov/documents/2020/02/25/2020-03170/usps-returns-service.
Initial onboarding will include:
·
Package Platform enrollment
·
USPS Returns enrollment
·
EPS account enrollment for electronic funds
transfer for payment of USPS Returns service postage.
·
USPS Web Tools API registration resulting in
generation of Web Tools user ID.
·
Mailer ID (MID) enrollment
·
Customer Registration ID (CRID) enrollment
·
Configuration of Destination Delivery Address
(where applicable)
·
Non-manifesting (SSF) Option: Supports creation of returns label to a
single delivery destination address configured per Web Tools UserID with the option of Signature Confirmation extra
service. Unique ZIP4 for returns supported. Note: The ability to generate
returns labels to multiple delivery destinations requires separate Web Tools UserIDs for each destination address.
·
Manifesting (SSF) Option (new): Supports creation of returns label to a
configured delivery destination address with options for Signature Confirmation
and Insurance extra services. Unique ZIP4 for returns supported. A Shipping
Services File will be submitted by Web Tools for returns labels on behalf of
the integrator.
·
Manifesting (SSF) eFulfillement
for Returns Option (new):
Supports creation of returns label for eFulfillment
returns customers to a delivery destination address collected in the API
request with options for Signature Confirmation and Insurance extra services. A
Shipping Services File will be submitted by Web Tools for returns labels on
behalf of the integrator. Note: The USPSReturnsLabel
API will validate destination addresses provided by eFulFillment
customers for a ZIP+4 or an error will return that includes an invalid ZIP+4.
Note: The “USPSReturnsLabelCertify” API is for testing purposes and will not generate usable labels and barcodes.
Scheme |
Host |
Path |
API |
XML |
||||
https:// |
secure.shippingapis.com |
/ShippingAPI.dll? |
API=USPSReturnsLabel |
&XML=(see below) |
||||
https:// |
secure.shippingapis.com |
/ShippingAPI.dll? |
API=USPSReturnsLabelCertify |
&XML=(see below) |
||||
Tag Name |
Occurs |
Description |
Type |
Validation |
||||||||
USPSReturnsLabelRequest |
Required |
Used with API=USPSReturnsLabel |
(Alias) |
|
||||||||
USPSReturnsLabelRequest / USERID |
Required |
This attribute specifies your WebTools user
ID. See the Developers
Guide for information on obtaining your USERID For example: <USERID = “XXXXXXXXXX”> |
NMTOKEN |
|
||||||||
USPSReturnsLabelRequest / Option |
Optional |
For future use. |
String |
|
||||||||
USPSReturnsLabelRequest / Revision |
Optional |
For future use. Used to indicate API version.
|
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>PDF</ImageType> |
String |
Enumeration= ·
PDF ·
TIF ·
NONE ·
ZPL |
||||||||
Optional |
Returns alternate label image. See Appendix A for Image parameter options. For example:
<ImageParameter>4X6LABEL</ImageParameter> |
String |
Default=4X6LABEL 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
“<CustomerAddress1/>” in the request. |
String |
minLength=0 |
||||||||
USPSReturnsLabelRequest /
CustomerAddress2 |
Required |
Address of customer returning the package.
(Primary Street address). For example: <CustomerAddress2>123 Main St.</CustomerAddress2> |
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>DC</CustomerState>
|
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. 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 https://pe.usps.com/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: <RetailerAddress1> may be specified
by Efulfillment customers using <ReturnsPostageType> = 5. The value supplied will
override the value stored in the Retailers WebTools Profile. Efulfillment
customers supplying an empty tag or not supplying this tag will also override
the value stored in the Retailers WebTools Profile resulting in no RetailerAddress1
line being displayed. |
String |
minLength=0 |
||||||||
USPSReturnsLabelRequest / RetailerAddress2 |
Conditionally required
(When <ReturnsPostageType> = 5) |
Address of Retailer
where the package will be returned. (Primary Street address). For example: <RetailerAddress2>123
Main St.</ RetailerAddress2> Note: <RetailerAddress2> is required for Efulfillment customers using <ReturnsPostageType>
= 5. Minimum of 1 character required. |
String |
minLength=1 |
||||||||
USPSReturnsLabelRequest / RetailerCity |
Conditionally required
(When <ReturnsPostageType> = 5) |
City of Retailer
where the package will be returned. Note: <RetailerCity>
is required for Efulfillment customers using <ReturnsPostageType> = 5. |
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: <RetailerZip5> is required for Efulfillment customers using <ReturnsPostageType>
= 5. |
String |
pattern=\d{5} |
||||||||
USPSReturnsLabelRequest / RetailerZip4 |
Conditionally required
(When <ReturnsPostageType> = 5) |
ZIP+4 Code of Retailer
where the package will be returned. Note: <RetailerZip4> is required for Efulfillment customers using <ReturnsPostageType>
= 5. |
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 Service. “FIRST CLASS” for First-Class
Package Return Service. “GROUND” for Ground
Return Service. |
String |
Enumeration= ·
PRIORITY ·
FIRST CLASS ·
GROUND |
||||||||
Conditionally required
(Required for Efulfillment users) |
The Postage Type
for the Returns Label. Note: Required for USPSReturns
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. https://pe.usps.com/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:
<Length>11</Length> 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. https://pe.usps.com/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. https://pe.usps.com/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 https://pe.usps.com/text/dmm300/index.htm. For example: <Girth>25</Girth> 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 |
Indicates if packaging is Machinable. Used
to calculate postage. For example:
<Machinable>true</Machinable> |
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. |
String |
minLength=0 |
||||||||
USPSReturnsLabelRequest / PrintCustomerRefNo |
Optional |
Indicated if the
<CustomerRefNo> data should be displayed on
the label. For example:
<Machinable>true</Machinable> |
Boolean |
Default=false Enumerations= ·
true ·
false |
||||||||
USPSReturnsLabelRequest / CustomerRefNo2 |
Conditionally required
(When <ReturnsPostageType> = 5) |
Used to collect
merchant ID. Note: <CustomerRefNo2> is required for Efulfillment customers using <ReturnsPostageType>
= 5. |
String |
minLength=0 |
||||||||
USPSReturnsLabelRequest / PrintCustomerRefNo2 |
Optional |
Indicated if the
<CustomerRefNo2> data should be displayed on the label. For example:
<Machinable>true</Machinable> |
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 returns label will be attached (true) or not (false) to the USPS
Tracking email. |
Boolean |
Default=false Enumerations=
|
||||||||
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:
<ExtraService> = “100” when <ServiceType> = “FIRST CLASS” or “GROUND”. <ExtraService> = “125” when <ServiceType>
= “PRIORITY”. |
String |
whiteSpace=collapse Enumeration= ·
100 ·
125 ·
156 |
|||||||||
Conditionally required
(When insurance extra service is also
indicated) |
Use this tag for entering an insurance
amount, if applicable. For example: <InsuredAmount>100.00</InsuredAmount> Note: The maximum insurance available may vary by the
Returns Mail Service type requested. |
Decimal |
minInclusive=0.0 |
|||||||||
USPSReturnsLabelRequest |
Required |
Used with API=USPSReturnsLabel |
(Alias) |
|
Non-manifesting (SSF) XML
Request: <USPSReturnsLabelRequest USERID="XXXXXXXXXX"> <Option/> <Revision></Revision> <ImageParameters> <ImageType>PDF</ImageType> <SeparateReceiptPage>false</SeparateReceiptPage> </ImageParameters> <CustomerFirstName>Cust First Name</CustomerFirstName> <CustomerLastName>Cust Last Name</CustomerLastName> <CustomerFirm>Customer Firm</CustomerFirm> <CustomerAddress1/> <CustomerAddress2>PO Box 100</CustomerAddress2> <CustomerUrbanization/> <CustomerCity>Washington</CustomerCity> <CustomerState>DC</CustomerState> <CustomerZip5>20260</CustomerZip5> <CustomerZip4>1122</CustomerZip4> <POZipCode>20260</POZipCode> <AllowNonCleansedOriginAddr>false</AllowNonCleansedOriginAddr> <RetailerATTN>ATTN: Retailer Returns Department</RetailerATTN> <RetailerFirm>Retailer Firm</RetailerFirm> <WeightInOunces>80</WeightInOunces> <ServiceType>PRIORITY</ServiceType> <Width>4</Width> <Length>10</Length> <Height>7</Height> <Girth>2</Girth> <Machinable>true</Machinable> <CustomerRefNo>RMA%23: EE66GG87</CustomerRefNo> <PrintCustomerRefNo>true</PrintCustomerRefNo> <CustomerRefNo2> EF789UJK </CustomerRefNo2> <PrintCustomerRefNo2>true</PrintCustomerRefNo2> <SenderName>Sender Name for Email</SenderName> <SenderEmail>senderemail@email.com</SenderEmail> <RecipientName>Recipient of Email</RecipientName> <RecipientEmail>recipientemail@email.com</RecipientEmail> <TrackingEmailPDF>true</TrackingEmailPDF> <ExtraServices> <ExtraService>156</ExtraService> </ExtraServices> </USPSReturnsLabelRequest> Manifesting (SSF) XML
Request: <USPSReturnsLabelRequest USERID="XXXXXXXXXX"> <Option/> <Revision/> <ImageParameters> <ImageType>PDF</ImageType> <SeparateReceiptPage>false</SeparateReceiptPage> </ImageParameters> <CustomerFirstName>Cust First Name</CustomerFirstName> <CustomerLastName>Cust Last Name</CustomerLastName> <CustomerFirm>Customer Firm</CustomerFirm> <CustomerAddress1/> <CustomerAddress2>150 CALLE A</CustomerAddress2> <CustomerUrbanization>URB REPTO VETERANO</CustomerUrbanization> <CustomerCity>San Juan</CustomerCity> <CustomerState>PR</CustomerState> <CustomerZip5>00926</CustomerZip5> <CustomerZip4>0221</CustomerZip4> <POZipCode>20260</POZipCode> <AllowNonCleansedOriginAddr>true</AllowNonCleansedOriginAddr> <RetailerATTN>ATTN: Retailer Returns Department</RetailerATTN> <RetailerFirm>Retailer Firm</RetailerFirm> <WeightInOunces>10</WeightInOunces> <ServiceType>FIRST CLASS</ServiceType> <Width>4</Width> <Length>10</Length> <Height>7</Height> <Girth>2</Girth> <Machinable>true</Machinable> <CustomerRefNo>RMA%23: EE66GG87</CustomerRefNo> <PrintCustomerRefNo>true</PrintCustomerRefNo> <CustomerRefNo2> EF789UJK </CustomerRefNo2> <PrintCustomerRefNo2>true</PrintCustomerRefNo2> <SenderName>Sender Name for Email</SenderName> <SenderEmail>senderemail@email.com</SenderEmail> <RecipientName>Recipient of Email</RecipientName> <RecipientEmail>recipientemail@email.com</RecipientEmail> <TrackingEmailPDF>true</TrackingEmailPDF> <ExtraServices> <ExtraService>100</ExtraService> </ExtraServices> <InsuredAmount>100</InsuredAmount> </USPSReturnsLabelRequest> Manifesting (SSF) eFulfillement for Returns XML Request: <USPSReturnsLabelRequest USERID="XXXXXXXXXX"> <Option/> <Revision/> <ImageParameters> <ImageType>PDF</ImageType> <SeparateReceiptPage>false</SeparateReceiptPage> </ImageParameters> <CustomerFirstName>Cust First Name</CustomerFirstName> <CustomerLastName>Cust Last Name</CustomerLastName> <CustomerFirm>Customer Firm</CustomerFirm> <CustomerAddress1>232</CustomerAddress1> <CustomerAddress2>PO Box 100</CustomerAddress2> <CustomerUrbanization/> <CustomerCity>Washington</CustomerCity> <CustomerState>DC</CustomerState> <CustomerZip5>20260</CustomerZip5> <CustomerZip4>1236</CustomerZip4> <POZipCode>20260</POZipCode> <AllowNonCleansedOriginAddr>true</AllowNonCleansedOriginAddr> <RetailerATTN>ATTN: Retailer Returns Department</RetailerATTN> <RetailerFirm>Retailer Firm</RetailerFirm> <RetailerAddress1>Ste 100</RetailerAddress1> <RetailerAddress2>2 Massachusetts Ave NE</RetailerAddress2> <RetailerCity>Washington</RetailerCity> <RetailerState>DC</RetailerState> <RetailerZip5>20212</RetailerZip5> <RetailerZip4>1726</RetailerZip4> <RetailerEmail>Returns@Retailer.com</RetailerEmail> <RetailerPhone>2125551234</RetailerPhone> <WeightInOunces>10</WeightInOunces> <ServiceType>GROUND</ServiceType> <ReturnsPostageType>5</ReturnsPostageType> <Width>4</Width> <Length>10</Length> <Height>7</Height> <Girth>2</Girth> <Machinable>true</Machinable> <VendorCode>1000</VendorCode> <VendorProductVersionNumber>102</VendorProductVersionNumber> <MailOwnerMID>817463</MailOwnerMID> <CustomerRefNo>RMA%23: EE66GG87</CustomerRefNo> <PrintCustomerRefNo>true</PrintCustomerRefNo> <CustomerRefNo2>EF789UJK</CustomerRefNo2> <PrintCustomerRefNo2>true</PrintCustomerRefNo2> <SenderName>Sender Name for Email</SenderName> <SenderEmail>senderemail@email.com</SenderEmail> <RecipientName>Recipient of Email</RecipientName> <RecipientEmail>recipientemail@email.com</RecipientEmail> <TrackingEmailPDF>true</TrackingEmailPDF> <ExtraServices> <ExtraService>100</ExtraService> </ExtraServices> <InsuredAmount>100</InsuredAmount> </USPSReturnsLabelRequest> |
Tag Name |
Occurs |
Description |
Type |
Validation |
||||||||
Required |
|
(Alias) |
|
|||||||||
USPSReturnsLabelResponse / BarcodeNumber |
Required |
Tracking / Confirmation number for the package. |
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>= “true” is specified in 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 for Returns API to determine RDC:
|
String |
|
||||||||
USPSReturnsLabelResponse / Postage |
Required |
Postage amount
for the Returns 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.0</DimensionalWeight> 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. https://pe.usps.com/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 |
Required |
|
(Alias) |
|
XML Response: <USPSReturnsLabelResponse> <BarcodeNumber>420211449302012345600000007248</BarcodeNumber> <LabelImage>---
Base 64 Binary stream Suppressed for documentation---</LabelImage> <RetailerFirm>Delivery
Destination Company</RetailerFirm> <RetailerAddress1/> <RetailerAddress2>12000 CHERRY HILL
RD</RetailerAddress2> <RetailerCity>Silver
Spring</RetailerCity> <RetailerState>MD</RetailerState> <RetailerZip5>20904</RetailerZip5> <RetailerZip4>1985</RetailerZip4> <RDC>0024</RDC> <Postage>8.44</Postage> <ExtraServices> <ExtraService> <ServiceID>156</ServiceID> <ServiceName>Signature
Confirmation Electronic</ServiceName> <Price>2.65</Price> </ExtraService> </ExtraServices> <Zone>01</Zone> <CarrierRoute>C031</CarrierRoute> </USPSReturnsLabelResponse> |
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 service label
Figure 2: USPS First-Class Package return service label
Figure 3:
USPS Ground Return service label