Best for:
- Creating an US Domestic or an International label.
- Retrieving an existing Label
- Deleting an existing label
Now that you have obtained an access token, let's start by using the Label endpoint which can generate a US Domestic or an International label.
Scope
The following operations are allowed in the Label API:
Operation | Type | Path |
Create Label (PNG, ZPL or PDF) | POST | /shipping/v4/label |
Get Label | GET | /shipping/v4/label/pickup |
Void Label | DELETE | /shipping/v4/label/pickup |
Each Label API request is used to create a single shipping label.
Each label requires a unique identifier called the packageId. For every successful label that is created, the response will contain the DHL unique package identifier, called the dhlPackageId.
After generating a label, a package will have the following identifiers used so it can be tracked:
packageId
: Customer-provided package ID, also known as the CCN (customer confirmation number) or the GM number.dhlPackageId
: DHL-generated package ID.trackingId
: Last-mile carrier package ID. For international shipments, this ID is only available after the package has been shipped. For domestic shipments, this ID contains the full USPS IMpb number and is always available.
Workflow
Customers can use this API to:
Create a shipping label for a single package (single physical mail item) using a unique reference of
- POST the label request and generate a Domestic Label.
- POST the label request and generate an International Label.
You can generate the labels in PNG and ZPL formats. API returns the label contents directly in the response in the requested format.
- ZPL labelData is provided with an encodeType of
PLAIN
. - PNG labelData is provided with an encodeType of
BASE64
. - PDF labelData is provided with an encodeType of
BASE64
.
The Label API is used by clients throughout the day as orders are fulfilled. At the end of the day, the Manifest API is used to manifest and print a DSM (Driver Summary Manifest).
Sample Domestic Label
Sample International Label
Please see Label Samples under the Reference section for hazmat label samples and requirements.