Additional Tips
Dangerous Goods
To indicate that a parcel contains hazardous materials in a Shipment Creation request (POST /shipments/ship), include the following parameters in the parcel object of the shipment:
"service_options": { "dangerous_goods": { "details": { "type": "CLASS_9_NEW_LITHIUM_DEVICE" } }}The hazmat code must be specified at shipment.parcels[i].service_options.dangerous_goods.details.type. Since each parcel can only contain one type of hazardous material, a multi-parcel shipment can be used to handle various hazmat materials and specify the appropriate hazmat code for each parcel.
Shipping Label Customizations
Please note that although many customization options are generally available, they are dependent on the carrier's specifications and requirements.
Each of these options is located in the main shipment body and should not be nested within any other object of the shipment request.
Label Format
eHub can generate labels of different format types. jpeg, png, pdf, zpl, epl2, gif, and tiff
For best label quality, we recommend using the zpl format with a ZPL-compatible printer.
"label_format": "zpl"Label Size
Typically 4"x6" labels are used but eHub can generate labels with the following sizes. '4x6', '4x8', '8x11', '8.5x11', '2 5/16x4', and '3 7/16x5 3/16'
"label_size": "4x6"Label Text and Contents
label_text1/label_text2- Custom text able to be printed on the labellabel_contentsThis object allows for custom text or even an image to be added to the label.
WARNING: Each carrier has strict guidelines regarding their shipping labels. Please reach out to support@ehub.com before attempting to utilize this feature.
"label_contents": [
{
"label_content": {
"type": "string",
"text": "string",
"base64_image": "string",
"location": [
0, 0 // X and Y coordinates
],
"width": 0,
"height": 0
}
}
]Multi Parcel Shipments
Some carriers allow you to split a shipment into multiple parcels by passing several parcel objects within the parcels array. If supported, you will receive multiple labels with different tracking numbers.
For any questions, contact support@ehub.com.
"parcels":[ { "name": "string", "length": 0.0, "width": 0.0, "height": 0.0, "weight": 0.0, ... }, { "name": "string", "length": 0.0, "width": 0.0, "height": 0.0, "weight": 0.0, ... }, { "name": "string", "length": 0.0, "width": 0.0, "height": 0.0, "weight": 0.0, ... },]USPS Test Labels
- All USPS test labels will have "VOID" printed all across the barcode
- The top postage payment area will specify that it is a test label.
- Test labels are not associated with a real Mailer ID or payment account (EPS) and cannot be accepted by the post office.
- Attempting to cancel or void a test label typically results in an error due to USPS limitations.
- While it’s recommended to develop functionality using test labels, ensure you test the cancellation process with a production label before going live.
How to Create FedEx OneRate Labels
To create FedEx OneRate shipments, you must specify both the eligible package type and the service in the shipment request body, based on the applicable contract
- Specify the Package Type and Service
Ensure the package_type corresponds to the FedEx OneRate contract, such as fedex_pak, and the service_id is based on the relevant service (usually fedex_2day).
2. Create the Shipment Request
Use both the corresponding FedEx OneRate package_type and service_id to create a valid shipment request for a FedEx OneRate shipment:
Shipment Request Example:
{ "shipment": { "to_location": {...}, "return_location": {...}, "from_location": {...}, "parcels": [ { "length": 2.0, "width": 2.0, "height": 2.0, "weight": 3.0, "package_type": "fedex_pak", // <------ Specified package type "parcel_items": [...] } ], "service_id": 393 // <------ FedEx service, e.g., fedex_2day }}On this page
- Additional Tips