USPS Returns Label API

 

USPS Web Tools™

Application Programming Interface

用户指南

Version 1.11 (07/25/2024)

 

 

 

 


 

目录

1.0      Introduction to Web Tools. 3

1.1      Before you get started: 3

2.0      USPS Returns Label API 3

2.1      Overview. 3

2.1.1   API Signature. 6

2.2      Request Descriptions. 6

2.2.1   Sample Request 19

2.3      Response Descriptions. 23

2.3.1   Sample Response. 28

3.0      Appendix A – Image Parameter Options. 30

4.0      Appendix B – Label Samples. 31

4.1      USPS Returns Label Sample – Priority Mail Return. 31

4.2      USPS Returns Label Sample – Priority Mail Express Return. 32

4.3      USPS Returns Label Sample – Ground Advantage Return. 33

5.0      Appendix C – Unique ZIP+4. 34

 


 

1.0        Introduction to Web Tools

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.

注意: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.

1.1         Before you get started:

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.

注意:The Web Tools user ID (i.e.“123ABCD456”) you receive upon registration will not work at www.usps.com (also reference: https://zh-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 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 上午-7:00 下午 Central. The USPS Returns web page can also be referenced: https://zh.usps.com/business/return-services.htm

注意: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.

注意: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.

2.0        USPS Returns Label API

2.1       Overview

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: https://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. 说明: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. 说明: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

可用

可用

可用

·        PRIORITY MAIL EXPRESS RETURN

可用

可用

可用

·        GROUND ADVANTAGE RETURN

可用

可用

可用

额外服务:

-

-

-

·        Insurance

不适用

可用

可用

·        HAZMAT Extra Services

可用

可用

可用

Ability to use multiple delivery destination addresses per Web Tools UserID. (Address collected in XML request and submitted in fSSF)

不适用

不适用

可用

Ability to specify Customer Reference Number(s) on label

可用

可用

可用

Ability to specify attention line on label for Delivery Destination Address

可用

可用

可用

Support Puerto Rican Origin Addresses

可用

可用

可用

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”

可用

可用

可用

·        ZPL (203 and 300 dpi)

Enumerations: “4X6ZPL203DPI” and “4X6ZPL300DPI”

可用

可用

可用

·        True 4x6 portrait

Enumeration: “4X6”

可用

可用

可用

·        True 6x4 landscape

Enumeration: “6X4”

可用

可用

可用

·        True 4x4 (restricted)

TBD

TBD

TBD

USPS Tracking Email

可用

可用

可用

USPS Tracking Email with PDF return label attachment

可用

可用

可用

Support unique Returns ZIP4

可用

可用

不适用

Generate Shipping Services File

不适用

可用

可用

Label volume reporting

可用

可用

可用

2D IMpb Barcode

可用

可用

可用

Optional Fees and Attributes (i.e., dim wt.) Breakdown

可用

可用

可用


 

2.1.1       API Signature

Scheme

Host

小道

API

XML

https://

secure.shippingapis.com

/ShippingAPI.dll?

API=USPSReturnsLabel

&XML=

(see below)

https://

secure.shippingapis.com

/ShippingAPI.dll?

API=USPSReturnsLabelCertify

&XML=

(see below)

 

注意:The “USPSReturnsLabelCertify” API is for testing purposes and will not generate usable labels and barcodes.

2.2             Request Descriptions

Tag Name

Occurs

描述

类型

Validation

USPSReturnsLabelRequest

需要

Used with API=USPSReturnsLabel

(Alias)

 

USPSReturnsLabelRequest / USERID

需要

This attribute specifies your Web Tools user ID. See the Developer's Guide for information on obtaining your USERID.

例如:USERID="XXXXXXX"

NMTOKEN

 

USPSReturnsLabelRequest / PASSWORD

需要

This attribute specifies your Web Tools password. See the Developer's Guide for information on your Password.

例如: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.

例如:<Revision>2</Revision>

String

minLength=0
pattern=\d{1}
pattern=  

USPSReturnsLabelRequest / ImageParameters

需要

Group containing all request parameters pertaining to the Label Image generation.

(Group)

 

USPSReturnsLabelRequest / ImageParameters / ImageType

需要

Label Image Type. See Appendix A for Image parameter options.

例如:<ImageType>PDF</ImageType>

String

Enumeration=

· PDF

· TIF

· NONE

· ZPL

USPSReturnsLabelRequest / ImageParameters/ ImageParameter

Optional

Returns alternate label image. See Appendix A for Image parameter options.

 

例如:<ImageParameter>4X6</ImageParameter>

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.

 

注意:<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
maxLength=50

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.

 

注意:<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
maxLength=50

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.

 

注意:<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
maxLength=50

USPSReturnsLabelRequest / CustomerAddress1

Conditionally required (if address needs secondary info)

Secondary address unit designator and number (such as an apartment or suite number). 例如:“APT 202” or “STE 100” etc.  

 

注意: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
maxLength=50

USPSReturnsLabelRequest / CustomerAddress2

需要

Address of customer returning the package. (Primary Street address). 例如:<CustomerAddress2>123 Main St.</CustomerAddress2>

String

minLength=1
maxLength=50

USPSReturnsLabelRequest / CustomerUrbanization

Conditionally required (if address is in Puerto Rico)

Urbanization of customer returning the package.

String

minLength=0
maxLength=50

USPSReturnsLabelRequest / CustomerCity

需要

City of customer returning the package.  

String

minLength=1
maxLength=28

USPSReturnsLabelRequest / CustomerState

需要

State of customer returning the package. Value should be passed as two-letter state abbreviation. 例如:<CustomerState>DC</CustomerState>  

String

pattern=\w{2}
pattern=  

minLength=2
maxLength=2

USPSReturnsLabelRequest / CustomerZip5

需要

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}
pattern=  

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.

例如:<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.

 

注意: 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

USPSReturnsLabelRequest / RetailerATTN

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.

 

注意:<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
maxLength=50

USPSReturnsLabelRequest / RetailerFirm

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.

 

注意:<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
maxLength=50

USPSReturnsLabelRequest / RetailerAddress1

Optional (May be specified when <ReturnsPostageType>=5)

Secondary address unit designator and number (such as an apartment or suite number). 例如:“APT 202” or “STE 100” etc.  

 

:<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
maxLength=50

USPSReturnsLabelRequest / RetailerAddress2

Conditionally required (When <ReturnsPostageType>=5)

Address of Retailer where the package will be returned. (Primary Street address). 例如:<RetailerAddress2>123 Main St.</ RetailerAddress2>

 

:<RetailerAddress2> is required for eFulfillment customers using <ReturnsPostageType>=5. Minimum of 1 character required.

String

minLength=1
maxLength=50

USPSReturnsLabelRequest / RetailerCity

Conditionally required (When <ReturnsPostageType>=5)

City of Retailer where the package will be returned.

 

:<RetailerCity> is required for eFulfillment customers using <ReturnsPostageType>=5.

String

minLength=1
maxLength=28

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. 例如:<RetailerState >DC</ RetailerState >  

 

:<RetailerState> is required for eFulfillment customers using <ReturnsPostageType>=5.

String

pattern=\w{2}
pattern=  

minLength=2
maxLength=2

USPSReturnsLabelRequest / RetailerZip5

Conditionally required (When <ReturnsPostageType>=5)

ZIP Code of Retailer where the package will be returned.

 

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

 

:<RetailerZip4> is required for eFulfillment customers using <ReturnsPostageType>=5.

String

pattern=\d{4}
pattern=  

USPSReturnsLabelRequest / RetailerEmail

Conditionally required (When <ReturnsPostageType>=5)

Email for Retailer of the return package.

 

:Either <RetailerEmail> OR <RetailerPhone> is required for eFulfillment customers using <ReturnsPostageType>=5.

String

pattern=([\w\-\.]+)@(([\w-]+\.)+)[a-zA-Z]{2,4}
pattern=  

USPSReturnsLabelRequest / RetailerPhone

Conditionally required (When <ReturnsPostageType>=5)

Phone number for Retailer of the return package.

 

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

例如:<WeightInOunces>80</ WeightInOunces>

 

注意: If weight not supplied, 4oz used.

Integer

Default=4

minInclusive=0
maxInclusive=1120  

USPSReturnsLabelRequest / ServiceType

需要

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

USPSReturnsLabelRequest / ReturnsPostageType

Conditionally required (Required for eFulfillment users)

The Postage Type for the Return label.

 

: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.
例如:<Width>5.5</ Width>

 

注意: 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
totalDigits=10

USPSReturnsLabelRequest / Length

Optional

Value must be numeric. Units are inches. Length should be longest dimension when compared to Width and Height values supplied.

例如:<Length>11</Length>

 

注意: 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
totalDigits=10

USPSReturnsLabelRequest / Height

Optional

Value must be numeric. Units are inches.
例如:<Height>7</Height>

 

注意: 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
totalDigits=10

USPSReturnsLabelRequest / Girth

Conditionally required (if package is non-rectangular)

注意: 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.

例如:<Girth>25</Girth>

注意: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
totalDigits=10

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.

 

说明:The API will validate provided dimensions and/or weight to determine machinability. In this case the <Machinable> tag will be ignored. If these are not provided, then the <Machinable> tag will be used to designate if shipment is Machinable (true) or Nonmachinable (false).

例如:<Machinable>正确</Machinable>

Boolean

Default=true

Enumerations=

· true

· false

USPSReturnsLabelRequest / VendorCode

Optional

 

String

minLength=0
maxLength=4

USPSReturnsLabelRequest / VendorProductVersionNumber

Optional

 

String

minLength=0
maxLength=8

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
maxLength=30

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.

 

注意:<CustomerRefNo2> is required for eFulfillment customers using <ReturnsPostageType>=5.

String

minLength=0
maxLength=30

USPSReturnsLabelRequest / PrintCustomerRefNo2

Optional

Used to print <CustomerRefNo2> data on the label. The <PrintCustomerRefNo2> must be set to “true” in order to display <CustomerRefNo2> value on the label.

 

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.

 

注意: No email is returned when generating a Sample (i.e., API=USPSReturnsLabelCertify) request.  

String

minLength=0
maxLength=50

USPSReturnsLabelRequest / SenderEmail

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.

 

注意:<RecipientEmail> must be populated to generate USPS tracking email notification. If <SenderEmail> provided without <RecipientEmail>, USPS tracking email notification will not be generated.

注意:No email is returned when generating a Sample (i.e., API=USPSReturnsLabelCertify) request.  

String

pattern=([\w\-\.]+)@(([\w-]+\.)+)[a-zA-Z]{2,4}
pattern=  

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.

 

注意:No email is returned when generating a Sample (i.e., API=USPSReturnsLabelCertify) request.  

String

minLength=0
maxLength=50

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.

 

注意:No email is returned when generating a Sample (i.e., API=USPSReturnsLabelCertify) request. 

String

pattern=([\w\-\.]+)@(([\w-]+\.)+)[a-zA-Z]{2,4}
pattern= 

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)

 

USPSReturnsLabelRequest / ExtraServices/ ExtraService

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:

 

Service Name

Service ID

保险

100

Insurance (Express)

101

Insurance (Priority)

125

HAZMAT Services

Service ID

Air Eligible Ethanol Package

810

Class 1 – Toy Propellant/Safety Fuse Package

811

Class 3 – Flammable Liquid Package

812

Class 7 – Radioactive Materials Package

813

Class 8 – Corrosive Materials Package

814

Class 8 – Nonspillable Wet Battery Package

815

Class 9 – Lithium Battery Marked – Ground Only Package

816

Class 9 – Lithium Battery – Return package

817

Class 9 – Lithium batteries, marked package

818

Class 9 – Dry Ice Package

819

Class 9 – Lithium batteries, unmarked package

820

Class 9 – Magnetized Materials Package

821

Division 4.1 – Flammable Solids or Safety Matches Package

822

Division 5.1 – Oxidizers Package

823

Division 5.2 – Organic Peroxides Package

824

Division 6.1 – Toxic Materials Package

825

Division 6.2 – Infectious Substances Package

826

Excepted Quantity Provision Package

827

Ground Only Hazardous Materials

828

ID8000 Consumer Commodity Package

829

Lighters Package

830

LTD QTY Ground Package

831

Small Quantity Provision Package

832

 

注意: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

 

USPSReturnsLabelRequest / InsuredAmount

Conditionally required (When insurance extra service is also indicated)

Use this tag for entering an insurance amount, if applicable.

例如:<InsuredAmount>100.00</InsuredAmount

 

注意:The maximum insurance available may vary by the Return Mail Service type requested.

Decimal

minInclusive=0.0
maxInclusive=5000.00

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.

例如:<WaiverOfSignature>true</WaiverOfSignature>

Boolean

Default=false

Enumerations=

·  true

·  false

USPSReturnsLabelRequest /ReturnFees

Optional

This tag must be set to “true” for <Fees> to be returned. This tag is used so customers can see what fees apply to their postage.

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.

例如:<OriginalTrackingNumberConstruct>C01</OriginalTrackingNumberConstruct>

String

 

USPSReturnsLabelRequest

需要

Used with API=USPSReturnsLabel 

(Alias)

 

 

2.2.1         Sample Request

 

Non-manifesting (SSF) XML Request:

<USPSReturnsLabelRequest USERID="XXXXXXXXX" PASSWORD="XXXXXXXXX">

<Option/>

<Revision></Revision>

<ImageParameters>

<ImageType>PDF</ImageType>

</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>正确</Machinable>

<CustomerRefNo>RMA%23: EE66GG87</CustomerRefNo>

<PrintCustomerRefNo>true</PrintCustomerRefNo>

<CustomerRefNo2> EF789UJK </CustomerRefNo2>

<PrintCustomerRefNo2>正确</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></ExtraService>

</ExtraServices>

</USPSReturnsLabelRequest>

 

Manifesting (SSF) XML Request:

<USPSReturnsLabelRequest USERID="XXXXXXXXX" PASSWORD="XXXXXXXXX">

<Option/>

<Revision>2</Revision>

<ImageParameters>

<ImageType>PDF</ImageType>

<ImageParameter>4X6</ImageParameter>

<ImageParameter>SEPARATERECEIPTPAGE</ImageParameter>

</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>EXPRESS</ServiceType>

<Width>4</Width>

<Length>10</Length>

<Height>7</Height>

<Girth>2</Girth>

<Machinable>正确</Machinable>

<CustomerRefNo>RMA%23: EE66GG87</CustomerRefNo>

<PrintCustomerRefNo>true</PrintCustomerRefNo>

<CustomerRefNo2> EF789UJK </CustomerRefNo2>

<PrintCustomerRefNo2>正确</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>101</ExtraService>

</ExtraServices>

<InsuredAmount>100</InsuredAmount>

<WaiverOfSignature>true</WaiverOfSignature>

</USPSReturnsLabelRequest>

 

Manifesting (SSF) eFulfillment for Return XML Request:

<USPSReturnsLabelRequest USERID="XXXXXXXXX" PASSWORD="XXXXXXXXX">

<Option/>

<Revision>2</Revision>

<ImageParameters>

<ImageType>PDF</ImageType>

<ImageParameter>6X4PAGE</ImageParameter>

</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>12</Width>

<Length>24</Length>

<Height>16</Height>

<Girth>0</Girth>

<Machinable>正确</Machinable>

<VendorCode>1000</VendorCode>

<VendorProductVersionNumber>102</VendorProductVersionNumber>

<MailOwnerMID>817463</MailOwnerMID>

<CustomerRefNo>RMA%23: EE66GG87</CustomerRefNo>

<PrintCustomerRefNo>true</PrintCustomerRefNo>

<CustomerRefNo2>EF789UJK</CustomerRefNo2>

<PrintCustomerRefNo2>正确</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>

<ReturnFees>true</ReturnFees>

</USPSReturnsLabelRequest>

 

2.3             Response Descriptions

Tag Name

Occurs

描述

类型

Validation

USPSReturnsLabelResponse

需要

 

(Alias)

 

USPSReturnsLabelResponse / BarcodeNumber

需要

Tracking / Confirmation number for the package. This tag returns a long form IMpb that includes routing information:

42020904198592019xxxxxxxxxxxxxxxxx

String

 

USPSReturnsLabelResponse / TrackingNumber

需要

Tracking / Confirmation number for the package. This tag returns a shortened IMpb that begins with the Channel Application ID:

92019xxxxxxxxxxxxxxxxx

TrackingNumber is available when <Revision> is greater than or equal to “2”

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.

 

注意: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).  

 

注意: 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>.

 

注意:<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). 例如:“APT 202” or “STE 100” etc. Configured “Delivery Destination Address2” used.

String

 

USPSReturnsLabelResponse / RetailerAddress2

需要

Address of Retailer receiving the return package. Configured “Delivery Destination Address” used.

String

 

USPSReturnsLabelResponse / RetailerCity

需要

City of Retailer receiving the return package. Configured “Delivery Destination City” used.

String

 

USPSReturnsLabelResponse /
RetailerState

需要

State of Retailer receiving the return package. Configured “Delivery Destination State” used.

String

 

USPSReturnsLabelResponse / RetailerZip5

需要

Zip5 of Retailer receiving the return package. Configured “Delivery Destination Zip Code” used.

String

pattern=\d{5}  

USPSReturnsLabelResponse / RetailerZip4

需要

Zip4 of Retailer receiving the return package. Configured “Delivery Destination Zip Code” used.

String

 

USPSReturnsLabelResponse / RDC

需要

Retail Distribution Code printed on label for USPS processing purposes.

 

注意:The following MCSetCodes are used by USPSReturnsLabel API to determine RDC:

服务

MCSetCode

Ground Return

0006

Priority Mail Return

0003

Priority Mail Express

0007

String

 

USPSReturnsLabelResponse / Postage

需要

Postage amount for the return package.

 

注意: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

需要

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

需要

邮递路线

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

需要

 

String

 

USPSReturnsLabelResponse / Fee / FeeType

需要

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

需要

Fee price. See Notice 123 for fee applicability and pricing.

String

 

USPSReturnsLabelResponse / Fees / Fee / FeeType / FeePrice / FeeInformation

需要

Fee Information indicates the fee is <Rate>

String

 

USPSReturnsLabelResponse / Fees / Fee / FeeType / FeePrice / FeeInformation / FeeInfo FeeInfoType=”PriceType

需要

Fee Information indicates the fee is <Rate>

String

 

USPSReturnsLabelResponse / Attributes

需要

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

需要

Attribute Key:

·        DimensionalWeightR = RetailRate

·        DimensionalWeightCB = Commercial Rate

·        DimensionalWeightCP = Commerical Plus Rate

·        Oversized

String

 

USPSReturnsLabelResponse

需要

 

(Alias)

 

 

2.3.1     Sample Response

 

XML Response:

<USPSReturnsLabelCertifyResponse>

    <BarcodeNumber>420202121726925989XXXXXXXXXXXXXXXX</BarcodeNumber>

    <TrackingNumber>925989XXXXXXXXXXXXXXXX</TrackingNumber>

    <LabelImage>--- Base 64 Binary stream Suppressed for documentation---</LabelImage>

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

    <RDC>0001</RDC>

    <Postage>43.71</Postage>

    <ExtraServices>

        <ExtraService>

            <ServiceID>100</ServiceID>

            <ServiceName>Insurance</ServiceName>

            <Price>3.40</Price>

        </ExtraService>

    </ExtraServices>

    <Zone>01</Zone>

    <DimensionalWeight>28</DimensionalWeight>

    <CarrierRoute>C000</CarrierRoute>

    <Fees>

        <Fee>

            <FeeType>Nonstandard Length fee > 22 in.</FeeType>

            <FeePrice>4.00</FeePrice>

        </Fee>

        <Fee>

            <FeeType>Nonstandard Volume fee > 2 cu. ft.</FeeType>

            <FeePrice>15.00</FeePrice>

        </Fee>

    </Fees>

    <Attributes>

        <Attribute Key="DimensionalWeight">28</Attribute>

    </Attributes>

</USPSReturnsLabelCertifyResponse>

 

 


 

3.0        Appendix A – Image Parameter Options

 

Image Parameter(s)

描述

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

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

PDF, TIF

6X4

SEPARATERECEIPTPAGE

2 images returned:

1) True 6x4 label True

2) Receipt on Full Page 8.5x11

PDF, TIF

4X6ZPL203DPI

1 image returned: 4x6 ZPL 203

ZPL

4X6ZPL300DPI

1 image returned: 4x6 ZPL 300

ZPL

 

4.0        Appendix B – Label Samples

4.1         USPS Returns Label Sample – Priority Mail Return

Figure 1: USPS Priority Mail Return label

4.2         USPS Returns Label Sample – Priority Mail Express Return

Figure 2: Priority Mail Express Return label

4.3         USPS Returns Label Sample – Ground Advantage Return

Figure 3: USPS Ground Advantage Return label

5.0        Appendix C – Unique ZIP+4

Web Tools USPSReturnsLabel allows a unique Returns ZIP4 which can be used instead of the ZIP4 returned from AMS in the XML response <RetailerZip4>, barcode, label, receipt, and SSF.

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.

 

Powered by Translations.com GlobalLink Web SoftwarePowered by GlobalLink Web