History AWB Order
Overview
Endpoint provides a detailed view of a shipment’s delivery history by tracking the status updates based on its AWB (Air Waybill) number. This endpoint acts as a bridge between your system and the courier’s tracking services, offering up-to-date delivery events that help merchants and customers stay informed about their package’s journey.
Tracking transparency is crucial for both operational teams and end-users. With this endpoint, businesses can monitor every logistical step — from pickup confirmation to successful delivery — improving delivery reliability, building trust with customers, and streamlining after-sales support in case of delays or delivery issues.
Whether you’re managing hundreds of daily shipments or offering individual tracking to customers via your application, this endpoint empowers your system to deliver real-time shipping visibility.
Key Feature
✅ Real-Time Delivery Status Updates : Retrieves real-time tracking history from the courier’s system using a valid AWB number. Includes timestamps, status codes, and detailed descriptions.
✅ Courier-Agnostic Integration : Automatically fetches tracking data from the relevant courier, depending on the logistics provider used in the original order.
✅ Structured Timeline : Returns a chronological series of events showing the full lifecycle of a package, from pickup, transit, attempted deliveries, to final delivery or return.
✅ Supports Customer Service Workflows : Can be used to proactively inform customers about delays, resolve complaints faster, and improve support ticket handling.
✅ Enables End-to-End Shipment Monitoring : Useful for operational dashboards or customer-facing tracking pages, allowing both internal teams and buyers to follow shipment progress.
✅ Compatible with Label-Generated Shipments : Designed to work in tandem with the POST /label-order process, ensuring traceability for each AWB assigned via the Komerce platform.
How it Works
- Order Label is Generated : When an order is created and labeled via POST /label-order, an AWB number is returned from the courier.
- Tracking Request Made : You send a GET request to the /history-airwaybill endpoint with the AWB number included as a query parameter.
- System Connects with Courier : Komerce routes the request to the relevant courier’s tracking system and retrieves the complete tracking log for that shipment.
- Receive Status Timeline : The API responds with a list of historical status updates, each containing a date-time, status code, and description of the event.
- Integrate with UI or Operations : The returned data can be displayed on merchant dashboards, customer tracking pages, or used by the operations team to follow up on shipments or raise support tickets.
- Refresh As Needed : This endpoint can be polled at intervals to refresh delivery status until the package reaches a final state (delivered, returned, canceled, etc.).
Request Body
- cURL
- JavaScript
- PHP
- GoLang
- Node
curl --location 'https://api-sandbox.collaborator.komerce.id/order/api/v1/orders/history-airway-bill?shipping={{courier}}&airway_bill=KOMERKOMXXXXXXXXXXXXXXXXX' \
--header 'x-api-key: inputapikey'
const myHeaders = new Headers();
myHeaders.append("x-api-key", "inputapikey");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://api-sandbox.collaborator.komerce.id/order/api/v1/orders/history-airway-bill?shipping={{courier}}&airway_bill=KOMERKOMXXXXXXXXXXXXXXXXX", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-sandbox.collaborator.komerce.id/order/api/v1/orders/history-airway-bill?shipping={{courier}}&airway_bill=KOMERKOMXXXXXXXXXXXXXXXXX',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: inputapikey'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.collaborator.komerce.id/order/api/v1/orders/history-airway-bill?shipping={{courier}}&airway_bill=KOMERKOMXXXXXXXXXXXXXXXXX"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-api-key", "inputapikey")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://api-sandbox.collaborator.komerce.id/order/api/v1/orders/history-airway-bill?shipping={{courier}}&airway_bill=KOMERKOMXXXXXXXXXXXXXXXXX',
headers: {
'x-api-key': 'inputapikey'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Query Parameter
Headers
Key | Type | Description |
---|---|---|
x-api-key * | string | this Value contain an secret APIKEY identic for Shipping API. |
Query Param
Key | Type | Description |
---|---|---|
shipping * | string | Name of the courier used for delivery of package. |
airway_bill * | string | AWB number that will be checked for package travel history. |
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
Key | Value (Description) |
---|---|
meta.message | Message indicating the result of the API request. |
meta.code | HTTP status code representing the request status. |
meta.status | Status of the API response (e.g., success or error). |
data.airway_bill | Display the AWB information that is being searched for package travel history. |
data.last_status | Display the delivery status information of the AWB that is being searched for travel history. |
data.history[].desc | Display descriptions related to AWB's travel history |
data.history[].date | Display package travel history time information |
data.history[].code | Display status code for travel history information |
data.history[].status | Display general status for travel history |
Success Respons for History AWB Order
{
"meta": {
"message": "success get data",
"code": 200,
"status": "success"
},
"data": {
"airway_bill": "KOMERKOMXXXXXXXXXXXXXXXXX",
"last_status": "{{ last status }}",
"history": [
{
"desc": "{{ description }}",
"date": "{{ YYYY-MM-DD HH:MM:SS }}",
"code": "{{ code }}",
"status": "{{ status }}"
}
]
}
}
Error Respons for History AWB Order
- Invalid cNote
- Failed Get
{
"meta": {
"message": "invalid cnote/airway bill",
"code": 400,
"status": "error"
},
"data": {}
}
{
"meta": {
"message": "failed get data",
"code": 422,
"status": "error"
},
"data": {
"errors": [
"Key: 'HistoryAirwayBillRequest.Shipping' Error:{{ query.params }} failed on the 'required' tag"
]
}
}
Error Code
Code | Status | Description | How to Fix |
---|---|---|---|
200 | Success | Success get data history AWB | |
400 | Invalid | AWB data not found | Make sure the AWB number data you are looking for is correct |
422 | Failed | Failed get data | Make sure the request parameter is available and has a value |
500 | - | - |
Tips to Avoid Error
✅ Use a valid AWB number generated from a successful POST /label-order call. Invalid or mistyped numbers will return no data or an error.
⏱️ Wait for pickup confirmation before making tracking requests. If the package hasn’t been scanned by the courier yet, the tracking history may be empty.
📦 Not all couriers support real-time tracking or may have delays in updating status. Build fallback logic for cases where tracking data is temporarily unavailable.
💡 Handle empty or null results gracefully, especially in UI displays, and inform users that tracking may not be available yet.
🔁 Implement rate-limiting and caching for high-frequency tracking requests to avoid performance bottlenecks or overuse of courier resources.
🔐 Avoid exposing query param AWB numbers on the client-side if your application needs privacy or added security for tracking details.