Return Label
v 4.0.0
Division: DHL eCommerce, US
This API allows you to create and retrieve return labels for a specific pickup customer account.
Region: North America
Overview

DHL eCommerce Americas Return Label API allows clients to create a return label for mail item(s) using an optional orderNumber and authorizationNumber.

Scope

The following operations are allowed in the Return Label API:

OperationTypePath
Create Return Label (PNG, ZPL, PDF or QR)POST/returns/v4/label
Get Return LabelGET/returns/v4/label/pickup
Important

Each Return Label API request is used to create a single return shipping label.

For every successful label that is created, the response will contain three tracking IDs:

  • authorizationNumber: Return item authorization number (RMA #)

  • dhlPackageId: DHL-generated package ID

  • trackingId: USPS IMpb number

Output Formats

The following return label formats are available:

  • PNG

  • ZPL

  • PDF

  • QR (see the Printerless Returns section below)

Workflow

Customers can use this API to:

  • Create a return shipping label for a single package using a POST request. You can generate the labels in PNG, ZPL or PDF formats. The API returns the label contents directly in the response in the requested format. When labelData is ZPL, it is provided with an encodeType of PLAIN. When labelData is PNG or PDF, it is provided with an encodeType of BASE64.
  • Acquire an existing return shipping label using the three tracking IDs using a GET request.

Sample Return Label

Printerless Returns

For your customers who do not have access to a printer or shipping labels, you have the option to provide a printerless return experience via the USPS Label Broker. When creating a return label, the format will beQR and the response will provide an image that contains the USPS Label ID and QR code. You must then send an email to your customer that contains the USPS Label ID and QR code image, see example image below:

This email should also include the following instructions:

Request Description

M- Mandatory O- Optional C- Conditional N- Not Applicable 

NodeData TypeRequired for DomesticLengthDescriptionExample Values
pickupstringM4:10DHL eCommerce pickup account number. This is not the same as the Sold To Account number.5320037
orderedProductIdstringM3DHL eCommerce three-character product code. See Reference for list of valid Product IDs. Refer here for more information.RGN
merchantIdstringO0:30Merchant account Id. Used for indicating the merchant for the sales order.ABC123
shipperAddressobjectM Address of the shipper. 
namestringC0:50Name of shipper.John Doe
companyNamestringC0:30Company name of shipper. Either name or company name is required.Acme Shoe Co.
address1stringM1:50Address Line 1 of shipper.5923 Peachtree Industrial Blvd
address2stringO0:50Address Line 2 of shipper.Peachtree Parkway
address3stringO0:50Address Line 3 of shipper.Peachtree City
citystringM1:40City of shipper.Norcross
statestringM0:50State of shipper.GA
countrystringM2Country of shipper. Must be a valid 2-character ISO country code.US
postalCodestringM3:10Postal Code of shipper. Only 5-digit (NNNNN) or extended 9-digit (NNNNN-NNNN) formats are allowed.30092
emailstringO0:50Email of shipper.john.doe@ email.com
phonestringO0:26Phone of shipper.678-896-4921
returnAddressobjectM Address where package is being returned to. 
namestringC0:50Name of return address.John Doe
companyNamestringC0:30Company name of return address. Either name or company name is required.Acme Shoe Co.
address1stringM1:50Address Line 1 of return.5923 Peachtree Industrial Blvd
address2stringO0:50Address Line 2 of return.Peachtree Parkway
address3stringO0:50Address Line 3 of return.Peachtree City
citystringM1:40City of return.Norcross
statestringM0:50State of return.GA
countrystringM2Country of return. Must be a valid 2-character ISO country code.US
postalCodestringM3:10Postal code of return. Only 5-digit (NNNNN) or extended 9-digit (NNNNN-NNNN) formats are allowed.30092
emailstringO0:50Email of return.john.doe@ email.com
phonestringO0:26Phone of return.678-896-4921
packageDetailobjectMObject that contains the package detail.  
orderNumberstringO0:50Order number of the item being returned.1234567
authorizationNumberstringO0:35Return items authorization number (RMA #) , also known as the CCN (customer confirmation number).A123456789BC
returnReasonstringO0:50Reason for returning the item."Wrong size received"
weightobjectM Object that contains the package weight details. Mainly used for validating and identifying the right shipping product. 
valuefloatM0:999999.99Total package weight.5
unitOfMeasurestring enumMLB, OZ, KG, GUnit of measure for weight.OZ

 

 

Response Description

M- Mandatory O- Optional C- Conditional N- Not Applicable 

NodeData typeRequiredLengthDescriptionExample Values
timestampstringM1:50Date and time of the label request; ISO-8601 date/time format.2021-02-10T19:38:36.411Z
pickupstringM4:10DHL eCommerce pickup account number. You will receive this after doing the onboarding with DHL eCommerce Sales team.5320037
orderedProductIdstringM3DHL eCommerce three-character product code that was requested.RGN
labelsarrayM Array that contains the package label details. 
createdOnstringM1:50The date and time of the label; ISO-8601 date/time format.2021-11-06T21:05:26+0000
authorizationNumberstringM0:35Return items authorization number (RMA #) , also known as the CCN (customer confirmation number).A123456789BC
dhlPackageIdstringM1:30DHL-generated package ID.3387191106122423
trackingIdstringM1:30Last-mile carrier package ID. This ID contains the full USPS IMpb number and is always available. If the package is overlabeled for any reason, this field contains the latest carrier package ID.420300929361269903500011492028
uspsLabelIdstringO0:10USPS QR Code label ID. Only available when format QR was requested. Not available for other output formats.ABCDEFGH8
labelDatastringM0:100000This will be a string containing the encoded shipping label image or a plain text zpl string depending on the format requested. 
encodeTypestring enumMBASE64, PLAINType of encoding for the label data.PLAIN
formatstringMZPL, PNG, PDF, QRFormat of the label data.ZPL
linkstringM1:150Link to the label that can be used to retrieve the label later.https://api.dhlecs.com/returns/v4/label/5320037?dhlPackageId=3387191106122423

Create Return Label

Body raw

{

"pickup": "5351244",
"orderedProductId": "RGN",
"merchantId":"test",
"shipperAddress": {
"name": "John Doe",
"companyName": "Doe Inc.",
"address1": "5923 Peachtree Industrial Blvd",
"address2": "Suite 100",
"address3": "Bldg 3",
"city": "Norcross",
"state": "GA",
"country": "US",
"postalCode": "30092",
"email": "2@y.com",
"phone": "44423440348"
},
"returnAddress": {
"name": "Dave Bloggs",
"address1": "5923 Peachtree Industrial Blvd",
"city": "Norcross",
"state": "GA",
"country": "US",
"postalCode": "30092"
},
"packageDetail":{
"orderNumber":"1234555",
"authorizationNumber":"1234567",
"returnReason":"defected product",
"weight":{
"value":5,
"unitOfMeasure":"LB"
}
}
}