Retrieve shipment documents - labels and customs documents
Returns documents for existing shipment(s). The call accepts multiple shipment numbers and will provide sets of documents for those. The format (PDF,ZPL) and method of delivery (URL, encoded, data) can be selected for all shipments and labels in that call. You cannot chose one format and delivery method for one label and different for another label within the same call. You can also specify if you want regular labels, return labels, cod labels, or customsDoc. Any combination is possible.
The call returns for each shipment number the status indicator and the selected labels and documents. If a label type (for example a cod label) does not exist for a shipment, it will not be returned. This is not an error. If you were sending multiple shipments, you will get an HTTP 207 response (multistatus) with detailed status for each shipment. Other standard HTTP response codes (200, 400, 401, 429, 500) are possible as well. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download (PDF). Note that the format settings per query parameters apply to the shipping label. Retoure label paper type can be specified separately since a different printer may be used here. If requesting labels to be returned as URL for separate download, the URLs provided can be shared.
Request
- Base URLhttps://api-eu.dhl.com/parcel/de/shipping/v2
- Auth
- API key in header dhl-api-key
- or HTTP basic
- or OAuth 2PasswordToken URL: /parcel/de/account/auth/ropc/v1/token
Query parameters
This parameter identifies shipments. The parameter can be used multiple times in one request to get the labels and/or documents for up to 30 shipments maximum. Only documents and label for shipments that are not yet closed can be retrieved.
Defines the printable document format to be used for label and manifest documents.
Defines the print medium for the shipping label. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.
Specific laser print formats using DIN A5 blanks are:
- 910-300-600(-oz) (105 x 205mm)
- 910-300-300(-oz) (105 x 148mm)
Specific laser print formats not using a DIN A5 blank:
- 910-300-610 (105 x 208mm)
- 100x70mm
Specific thermal print formats:
- 910-300-600 (103 x 199mm)
- 910-300-400 (103 x 150mm)
- 100x70mm
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default.
Defines the print medium for the return shipping label. This parameter is only usable, if you do not use combined printing. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.
Specific laser print formats using DIN A5 blanks are:
- 910-300-600(-oz) (105 x 205mm)
- 910-300-300(-oz) (105 x 148mm)
Specific laser print formats not using a DIN A5 blank:
- 910-300-610 (105 x 208mm)
- 100x70mm
Specific thermal print formats:
- 910-300-600 (103 x 199mm)
- 910-300-400 (103 x 150mm)
- 100x70mm
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default.
Legacy name labelResponseType. Shipping labels and further shipment documents can be:
- include: included as base64 encoded data in the response (default)
- URL: provided as URL reference. Default is include the base64 encoded labels.
If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels.
Headers
Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english.
Response
Success response for requests with a single shipment.
Example response
{
"status": {
"title": "ok",
"statusCode": 200,
"status": 200,
"detail": "The Webservice call ran successfully."
},
"items": [
{
"shipmentNo": 340434310428091700,
"routingCode": "40327653113+99000943058020",
"sstatus": {
"title": "OK",
"status": 200
},
"label": {
"url": "https://api-dev.dhl.com/parcel/de/shipping/v1-feature-order-endpoint/labels?token=x5xzrHE7ctmqPqk33k%2BKkBwbvIfYP4elMQsBFM%2BJOdiT2bmoaXXzris%2Ftz9jBtdVFLY5cCENit0Jnd9aXuxoNEXhP9PQ8tAVdPeXD26RZ6JZqF5NCJlrihrAv1%2FAOzuDPqWJLRVaRq461BpT4bcbzChAAHVg%2FHUaQAkeIkaZ8NqfcxWEQzK1AYJWczpy6sv6",
"format": "PDF"
}
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.