Merchant API: shipping labels (last-mile delivery)
About this article
This article describes how to request and retrieve shipping labels from a marketplace via the Merchant API, including last-mile delivery. It covers both label flows (with and without carrier selection), label retrieval, and Air Waybill numbers.
Table of contents
Introduction
Last-mile delivery is the transportation of goods from a warehouse/distribution center to the final delivery destination, i.e.: the customer. Some marketplaces, such as Allegro, Shopee, Lazada, Miravia, noon, TikTok Shop, and Trendyol, offer last-mile delivery services, alongside marketplace fulfillment services. The last-mile delivery service focuses solely on the delivery aspect of the logistics process, excluding picking and packing of the goods. You pick and pack the goods, and the marketplace completes the delivery to the buyer.
When your channel manages the shipping method, e.g.: Amazon, bol, or Kaufland, ChannelEngine can also request a label from the marketplace on your behalf. Which shipping label flow you follow depends on whether you select the carrier service yourself or whether the marketplace assigns it automatically: Pattern A or Pattern B.
To compare the order flow with and without last-mile delivery, check out the flowchart Merchant API data flow: last-mile delivery. To learn how to create, retrieve, and update shipments, check out Merchant API: shipments.
Overview of the process
Follow these steps to ship your orders using last-mile delivery or marketplace-generated labels.
Get orders
- Retrieve new orders from ChannelEngine via
GET /v2/orders/new. - Acknowledge orders via
POST /v2/orders/acknowledgement. Store amerchantOrderNofor each order. - Pick and pack the items in your warehouse.
If an order cannot be delivered (e.g.: due to insufficient stock), follow the cancelation process. Otherwise, proceed to shipment creation.
Create shipments
Depending on the marketplace, you either select a carrier from the channel's list of available carriers (Pattern A) or automatically use the carrier that the marketplace provides (Pattern B), which is the case for marketplaces that offer last-mile delivery services.
Shipping label Pattern A vs. B comparison
| Pattern | Channels | How it works |
| Pattern A: carrier selection | Amazon, bol, Kaufland, HepsiBurada | You choose a carrier service from the options the marketplace provides, create the shipment via POST /v2/shipments/channelmethod, and ChannelEngine requests the label from the marketplace. |
| Pattern B: delivery by marketplace | Shopee, Miravia, TikTok Shop, Trendyol, Lazada | The marketplace or ChannelEngine assigns the shipping method. You create the shipment via POST /v2/shipments with only the name of the marketplace as the shipping method, and ChannelEngine requests the label in the background. The label may be available after a delay. |
Pattern A: carrier selection
Marketplaces like bol, Amazon, and Kaufland require you to select a carrier (i.e.: shipping method) when creating a shipment. Follow these steps to request a label when you select the carrier service from the list that the marketplace provides.
- Call
POST /v2/carriers/{merchantOrderNo}and include the package weight and dimensions in your request. The response returns the carrier services available for that order, each with acode. - Select the service you want to use and store its
code. - Call
POST /v2/shipments/channelmethodand pass the stored code asChannelMethodCode. IncludeMerchantShipmentNo,MerchantOrderNo, and package data (i.e.: items, weight, and dimensions). - Poll
GET /v2/orders/{merchantShipmentNo}/shippinglabeluntil ChannelEngine retrieves the label. See Retrieve shipping labels.
-
Create a shipment and request a label:
POST /v2/shipments/channelmethod
Use this endpoint to create the shipment and initiate label generation with the carrier service you selected.
Request body when requesting a label with POST /v2/shipments/channelmethod
| Field | Type | Required | Notes |
MerchantShipmentNo |
string | Yes | Your unique shipment reference. |
MerchantOrderNo |
string | Yes | Your order reference. |
ChannelMethodCode |
string | Yes | The carrier service code returned by POST /v2/carriers/{merchantOrderNo}. |
Lines |
array | Yes | The shipped items, each with MerchantProductNo and Quantity. |
Dimensions |
object | Yes | The package dimensions: Height, Width, Length, and Unit (CM or INCH). |
Weight |
object | Yes | The package weight: Value and Unit (GRAM or OUNCE). |
ShippedFromCountryCode |
string | No | The country the parcel is dispatched from. See the field notes in Merchant API: shipments. |
ShippedFromStockLocationId |
integer | Conditional | Required if you use multiple stock locations. |
Pattern B: delivery by marketplace
On channels where the marketplace controls the shipping method, such as Shopee, Miravia, TikTok Shop, and Trendyol, the marketplace generates the label and the tracking number. You therefore do not have a carrier tracking number to provide. Instead, you tell ChannelEngine from which marketplace to request the label, and ChannelEngine handles the label request and tracking import in the background.
- Go to Settings, Shipment methods, and add a shipment method. Use the name of the marketplace as the Name (e.g.: Lazada or Miravia).
- Go to Mappings, Carrier mappings, and add a carrier mapping. Select the shipment method Name from the dropdown in Your shipping method, select All countries as Customer delivery country, and enter the marketplace name as Channel. If this mapping is not set, ChannelEngine does not request the label.
- Call
POST /v2/shipmentswith the required fields (see Merchant API: shipments) and setMethodto the shipment method Name. Do not sendTrackTraceNo, because the marketplace provides it. - Retrieve the label as described in Retrieve shipping labels.
Retrieve shipping labels
-
Download a shipping label:
GET /v2/orders/{merchantShipmentNo}/shippinglabel
After you create a shipment, ChannelEngine requests a shipping label from the marketplace. This process runs in real time or as a scheduled task, depending on the channel configuration.
Some channels (e.g.: Shopee) rely on periodic imports, so the label may not be available immediately. Handle temporary unavailability using polling or retry logic.
- Retrieve your shipping label via
GET /v2/orders/{merchantShipmentNo}/shippinglabelorGET /v2/orders/documents. Store it and make it available for printing or download in your warehouse workflow. - Download and print the label, then attach it to the parcel.
- If required by the marketplace (e.g.: Miravia), update tracking and shipment status via
PUT /v2/shipments/{merchantShipmentNo}.
The format (PDF, PNG, or ZPL) is determined by the channel and its configuration on ChannelEngine, not by your request. ChannelEngine does not convert labels for you. Check the channel-specific guide to determine which format the channel provides, and route each file to the matching print or storage flow, e.g.: PDF and PNG to a standard printer or document store, and ZPL to a thermal label printer.
404 response from the shipping label endpoint does not mean the shipment failed. It means the label is not ready yet. Some channels (such as Shopee and Miravia) rely on background import tasks, so there can be a delay of minutes to hours between shipment creation and label availability. Always implement polling or a user-triggered retry in your integration.Response codes when downloading a shipping label
| Response code | Meaning |
200 |
The label is available. The response body contains the file. |
404 |
The label is not yet available. Retry after a short interval. |
410 |
The label is no longer available (e.g.: expired or superseded). |
Retrieve the Air Waybill number
-
Retrieve the Air Waybill (AWB) number:
GET /v2/orders/{merchantShipmentNo}/airwaybillno
On certain marketplaces, ChannelEngine generates the Air Waybill (AWB) number for you, so you do not have a carrier tracking number of your own. If the marketplace guide indicates this, use this endpoint to retrieve the number and use it as the tracking code of the shipment. Replace {merchantShipmentNo} with the shipment reference you assigned at creation.
- Create the shipment as described for your channel, e.g.: via
POST /v2/shipmentswithout aTrackTraceNo. - Call
GET /v2/orders/{merchantShipmentNo}/airwaybillnoto retrieve the AWB number. - Use the returned number as the tracking code for the parcel, e.g.: in your WMS or on your packing documents.
AirWaybillNo field notes in Merchant API: shipments.
Marketplace-specific settings
Marketplaces that offer shipping labels to sellers may require specific settings to enable retrieving shipping labels via ChannelEngine. These settings may include, in the channel's Setup step:
- Go to Plugin-specific settings, Fulfillment type. From the dropdown, select Delivery by [marketplace name] or Last-mile delivery, depending on the available options in the plugin. Some marketplaces allow you to fulfill orders via a combination of fulfillment programs and, therefore, do not have this setting in the Setup step.
- In Advanced settings, you may need to configure the following settings:
- Realtime shipment export - select Yes to export your shipment to the marketplace as soon as you create the shipment in your system. Select No to optimize your environment's performance.
- Pack order after import - select Yes to automatically update the status of incoming orders to Packing.
In all cases, read your marketplace's specific guide to understand which settings and which steps to follow to retrieve your shipment's shipping label. E.g.: some marketplaces require that sellers participate in exclusive programs to obtain the relevant shipping labels for last-mile delivery. Yet others have specific requirements for carrier mapping.
Find your marketplace guide in the ChannelEngine Help Center under Marketplaces.
Example requests
Pattern A shipment with a marketplace label
POST /v2/shipments/channelmethod
{
"MerchantShipmentNo": "SHIP-20260817-003",
"MerchantOrderNo": "ORD-98767",
"ChannelMethodCode": "DHL_STANDARD_NL",
"Lines": [
{
"MerchantProductNo": "SKU-003",
"Quantity": 1
}
],
"Dimensions": {
"Height": 15,
"Width": 30,
"Length": 40,
"Unit": "CM"
},
"Weight": {
"Value": 1200,
"Unit": "GRAM"
}
}Pattern B shipment (no tracking details)
POST /v2/shipments
{
"MerchantShipmentNo": "SHIP-20260817-004",
"MerchantOrderNo": "ORD-98768",
"Lines": [
{
"MerchantProductNo": "SKU-004",
"Quantity": 1
}
],
"Method": "Lazada"
}Common issues
| Issue | Cause | Solution |
Label request returns 404
|
The label is not ready yet. Some channels rely on background imports. | Retry at a short interval. Do not treat 404 as a permanent failure. |
Label request returns 410
|
The label is no longer available, e.g.: because it expired or was superseded. | Check the shipment status on ChannelEngine. Contact ChannelEngine Support if you need a new label. |
| No label is requested on a Pattern B channel | The Method does not match the marketplace name exactly, or the carrier mapping is missing or not set to All countries. |
Check the shipment method name and the carrier mapping. See Pattern B: delivery by marketplace. |
Next steps
- Merchant API: shipments - create, retrieve, and update shipments, and confirm delivery.
- Merchant API: testing shipments in your sandbox - verify your shipment integration before going live.
- Managing orders via the Merchant API - retrieve, acknowledge, and cancel orders, and submit invoices.
Comments
0 comments
Article is closed for comments.