> For new integrations, EasyParcel recommends the NextGen API: https://developer.easyparcel.com/

# Tracking Parcel Details

> EasyParcel API · Malaysia · Individual · version 1.4.0.0
> Page: https://developers.easyparcel.com/my/individual/tracking-parcel-details · Markdown: https://developers.easyparcel.com/my/individual/tracking-parcel-details.md · PDF: https://developers.easyparcel.com/pdf/Malaysia_Individual_1.4.0.0.pdf

Track the shipment status using airway bill number.

## Endpoint

- Method: `POST`
- Demo URL: `http://demo.connect.easyparcel.my/?ac=EPTrackingBulk`
- Live URL: `https://connect.easyparcel.my/?ac=EPTrackingBulk`
- Body: `application/x-www-form-urlencoded`. Nested fields use PHP `http_build_query` names, e.g. `bulk[0][pick_code]`.
- Action: `EPTrackingBulk`

## Request parameters

### Request L1

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `api` | string(25) | Yes | Obtain from registered account. |
| `bulk` | array | Yes | (Refer to [Request L2](#request-l2)) |

### Request L2 · `bulk[]` {#request-l2}

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `awb_no` | string(25) | Yes | Generate automatically after the payment. |

## Sample code

### PHP

```php
<?php
$domain = "https://demo.connect.easyparcel.my/?ac=";

$action = "EPTrackingBulk";
$postparam = array(
    'api' => 'xxxxxx',
    'bulk' => array(
        array(
            'awb_no' => '238725129086',
        ),
        array(
            'awb_no' => '238725129086',
        ),
    ),
);

$url = $domain.$action;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postparam));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

ob_start();
$return = curl_exec($ch);
ob_end_clean();
curl_close($ch);

$json = json_decode($return);
echo "<pre>"; print_r($json); echo "</pre>";
?>
```

### cURL

```bash
curl -X POST 'https://demo.connect.easyparcel.my/?ac=EPTrackingBulk' \
  --data-urlencode 'api=xxxxxx' \
  --data-urlencode 'bulk[0][awb_no]=238725129086' \
  --data-urlencode 'bulk[1][awb_no]=238725129086'
```

## Response

### Response L1

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `api_status` | string(10) | Validation result | (Refer to [Appendix I](https://developers.easyparcel.com/my/individual/appendix/api-return-status.md)) |
| `error_code` | int(5) | Error code | (Refer to [Appendix I](https://developers.easyparcel.com/my/individual/appendix/api-return-status.md)) |
| `error_remark` | string(100) | Error message | (Refer to [Appendix I](https://developers.easyparcel.com/my/individual/appendix/api-return-status.md)) |
| `result` | array | Result of tracking | (Refer to [Response L2](#response-l2)) |

### Response L2 · `result` {#response-l2}

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `status_list` | array | The result for trackings. | (Refer to [Response L3](#response-l3)) |
| `latest_status` | string(45) | The status of the shipment from courier partners. |  |
| `latest_update` | string(45) | Show the date and time. |  |
| `awb` | string(45) | Airway bill number. |  |

### Response L3 · `status_list` {#response-l3}

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `status` | string(45) | The status of the shipment. (standardised) |  |
| `sender` | string(45) | The name of the sender |  |
| `receiver` | string(45) | The name of the receiver |  |

### Response L4

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `event_date` | date | Show date. |  |
| `event_time` | time | Show time. |  |
| `status` | string(150) | The status of the shipment from courier partners. |  |
| `ep_status` | string(100) | The shipment status from EasyParcel. |  |
| `ep_status_code` | int(2) | The status code of shipment status from EasyParcel. (correspond to ep_status) | 1 : Schedule In Arrangement, 2 : To Be Collected, 3 : Collected, 4 : Delivery In Transit / On Hold, 5 : Delivered / Returned |
| `location` | string(100) | Track the location of the parcel. |  |

## Response samples

### Success

```json
{
  "api_status":"Success",
  "error_code":"0",
  "error_remark":"",
  "result":[
    {
      "status_list":{
        "0":{
          "event_date":"2017-10-28",
          "event_time":"11:40 AM",
          "status":"Deliverd",
          "location":"Penang"
        },
        "1":{
          "event_date":"2017-06-28",
          "event_time":"11:40 AM",
          "status":"Parcel has been collected at Penang",
          "location":"Penang"
        },
        "status":"",
        "sender":"Yong Tat",
        "receiver":"Sam"
      },
      "latest_status":"Deliverd",
      "latest_update":"2017-10-28",
      "awb":"238725129086"
    },
    {
      "status_list":{
        "0":{
          "event_date":"2017-10-28",
          "event_time":"11:40 AM",
          "status":"Deliverd",
          "location":"Penang"
        },
        "1":{
          "event_date":"2017-06-28",
          "event_time":"11:40 AM",
          "status":"Parcel has been collected at Penang",
          "location":"Penang"
        },
        "status":"",
        "sender":"Yong Tat",
        "receiver":"Sam"
      },
      "latest_status":"Deliverd",
      "latest_update":"2017-10-28",
      "awb":"238725129086"
    }
  ]
}
```

### Fail

```json
{
  "api_status":"Error",
  "error_code":"3",
  "error_remark":"Required api key",
  "result":[
    
  ]
}
```

## Referenced appendices

Copied from the appendix pages linked above.

### Appendix I: API Return Status

Source: https://developers.easyparcel.com/my/individual/appendix/api-return-status.md

| api_status | error_code | error_remark | Explanation |
| --- | --- | --- | --- |
| Success | 0 |  |  |
| Error | 1 | Required authentication key | Missing authentication param |
| Error | 2 | Invalid authentication key |  |
| Error | 3 | Required api key | Missing API key param |
| Error | 4 | Invalid api key |  |
| Error | 5 | Unauthorized user | Invalid API key |
| Error | 6 | Required bulk array |  |
| Error | 7 | Required bulk data insert format in array |  |
| Error | 8 | Invalid account |  |
| Error | 9 | Unverified account. Please kindly verify your account at easyparcel.com |  |
| Error | 1000 | Missing / Invalid Parameter | If a required parameter is missing or an invalid value is entered, the error will be displayed in the error_detail field. |
| Error | 1002 | Invalid User Account | The user does not have a wallet associated with the relevant country. |
| Error | 1003 | Invalid parcel category, you should refer to Get Parcel Category API | Invalid parcel category, you should refer to Get Parcel Category API |
| Error | 1004 | Invalid collection/ delivery postcode |  |
| Error | 1005 | Invalid collection/delivery state | If the value is "Pulau Penang," an error will occur because our system only accepts state codes. |
| Error | 1006 | Invalid courier | Incorrect Courier code |
| Error | 3001 | Shipment insured | This tracking number has previously purchased insurance through EasyParcel, cannot buy insurance again |
| Error | 3002 | Shipment delivered | The status of this tracking number shipment is "delivered", not allow to buy insurance |
| Error | 3003 | Not under claim coverage | The courier insurance provides coverage for parcel contents up to RM200. However, since you entered a parcel content value of RM100, it does not qualify for claim coverage. |
| Error | 3004 | Only support international/domestic shipment | For example, Fedex only supports international shipments to buy insurance |
| Error | 3005 | No Cover | If the collection state or delivery location is not within the insurance coverage area, an error message along with a description will be displayed. |
| Error | 9999 | Unknown error | If this error occurs, please contact our support team for assistance. |

Support: WhatsApp EasyParcel API Support — https://api.whatsapp.com/send/?phone=6042023160

Published by EasyParcel Sdn Bhd (1028666-H).
