Skip to main content

Label Order

Overview

The Label Printing Endpoint allows users to generate and print shipping labels (resis) for their orders. This feature supports both bulk printing and different label formats to accommodate various shipping and logistical needs.

Users can request labels for one or multiple orders by providing the order number(s). Additionally, they can specify the label format and page size based on their printer type and operational requirements.

Key Feature

✅ Orders Must Be Eligible → Only orders ready for shipment can have labels printed.
✅ Bulk Printing Supported → Multiple orders can be processed in a single request.
✅ Correct Page Format Required → Users must specify a valid page type for label generation.

Use Cases for Label Printing

✅ E-commerce Sellers → Quickly generate shipping labels for multiple orders.
✅ Warehouses & Fulfillment Centers → Automate bulk label printing.
✅ Courier Management → Standardize label formats for efficient logistics.

By using the Label Printing Endpoint, businesses can streamline their order processing, reduce manual errors, and improve shipping efficiency. 🚀

How it Works

Once an order is created and the pickup is successfully scheduled, the next critical step is to generate a shipping label — a document used by logistics partners to track, transport, and deliver the package. This is done through the POST /label-order endpoint.

From a business perspective, here’s how the process flows:

  1. Order Confirmation: A customer places an order through your platform. This order is recorded in the system using the store-order API.
  2. Pickup Scheduled: Once the order is confirmed, your system schedules a pickup with the selected logistics provider using the pickup-order endpoint. This ensures the courier knows when and where to collect the package.
  3. Label Generation: After the pickup is scheduled, the label-order endpoint is called to generate the shipping label. This label includes the AWB (Air Waybill) number and essential delivery details. It serves as a ticket for the courier to recognize and deliver the parcel.
  4. Download & Attach: The label is returned in PDF format and should be downloaded and printed. The merchant or warehouse team then attaches this label to the package before handing it over to the courier.
  5. Package Ready for Delivery: Once labeled, the package is fully ready for pickup and delivery, ensuring a smooth handoff to logistics and end-to-end traceability.

Why It Matters for Business

  • Ensures traceability with valid AWB numbers.
  • Reduces manual errors during order processing.
  • Improves delivery reliability by aligning with logistics partner requirements.
  • Keeps your operations scalable and automated.

Request Body

curl --location --request POST 'https://api-sandbox.collaborator.komerce.id/order/api/v1/orders/print-label?page=page_5&order_no=KOMXXXXXXXXXXXXXXXXX' \
--header 'x-api-key: inputapikey'

Query Parameter

Headers

KeyTypeDescription
x-api-key*stringthis Value contain an secret APIKEY identic for Shipping API.

Query Param

KeyTypeDescription
page*stringThe label format and page size for printing. Options include: page_1 (A4 size, 1 label per page), page_2 (A4 size, 2 labels per page), page_4 (A4 size, 4 labels per page (A6 format)), page_5 (Thermal size 10cm x 10cm), and page_6 (Thermal size 10cm x 15cm)
order_no*stringThe order number(s) to generate labels for. Multiple orders can be specified using a comma separator (,).
danger

For each header and parameter that has a * sign, it is a parameter that must be Required when making a request, otherwise there will be a system error that will warn the user regarding the request made.

Response

Response Structure

KeyValue (Description)
meta.messageMessage indicating the result of the API request.
meta.codeHTTP status code representing the request status.
meta.statusStatus of the API response (e.g., success or error).
data.pathOrder label storage location
data.base_64Binary code to generate the label file

Success Respons for Get Order Label

{
"meta": {
"message": "Generate Print Label success",
"code": 200,
"status": "success"
},
"data": {
"path": "/storage/label-DD-MM-YYY-00-00-00000000000.pdf",
"base_64": "{{ long_base_64 }}
}
}
Important

If want to download shipping label request result file, you need to understand that it is necessary to add the /order path before /storage/label-DD-MM-YYY-00-00-00000000000.pdf.

Error Respons for Get Order Label

{
"meta": {
"message": "Generate Print Label failed",
"code": 500,
"status": "error"
},
"data": "order_no not found"
}

Error Code

CodeStatusDescriptionHow to Fix
200SuccessSuccess generate print label
401UnauthorizedAPI key invalid or missing from parameterMake sure your API key is valid using your Account
422ErrorGenerate print label failedEnsure that the query parameters of the given request are appropriate
500Generate print label failedorder_no not foundMake sure the order_no requested to generate the label matches the data you have.

Tips to Avoid Error

  1. Ensure Pickup is Scheduled: Before generating a label, confirm that the pickup has been successfully scheduled using the POST /pickup-order endpoint.
  2. Use a Valid order_no: Verify that the order_no provided exists and corresponds to an order that has completed the pickup scheduling process.
  3. Avoid Duplicate Label Requests: Once a label has been generated for an order, refrain from making additional label generation requests for the same order to prevent duplication errors.
  4. Check Order Status: Labels can only be generated for orders that are in the appropriate status (e.g., “Pickup Scheduled”). Attempting to generate a label for an order in an incorrect status will result in an error.
  5. Validate API Token: Ensure that your API token is valid and has the necessary permissions to perform label generation operations.
  6. Handle Errors Gracefully: Implement error handling in your application to manage scenarios where label generation fails, such as displaying user-friendly messages or retrying the operation as appropriate.