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

# Tracking Parcel Details

> EasyParcel API · Singapore · MarketPlace · version 1.1.1.0
> Page: https://developers.easyparcel.com/sg/marketplace/tracking-parcel-details · Markdown: https://developers.easyparcel.com/sg/marketplace/tracking-parcel-details.md · PDF: https://developers.easyparcel.com/pdf/Singapore_MarketPlace_1.1.1.0.pdf

Track the shipment status using airway bill number.

## Endpoint

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

## Request parameters

### Request L1

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `authentication` | string(25) | Yes | Obtain from EasyParcel IT administrator |
| `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.sg/?ac=";

$action = "MPTrackingBulk";
$postparam = array(
    'authentication' => 'xxxxxx',
    'api' => 'xxxxxx',
    'bulk' => array(
        array(
            'awb_no' => '86983175113435',
        ),
        array(
            'awb_no' => '86983175113435',
        ),
    ),
);

$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.sg/?ac=MPTrackingBulk' \
  --data-urlencode 'authentication=xxxxxx' \
  --data-urlencode 'api=xxxxxx' \
  --data-urlencode 'bulk[0][awb_no]=86983175113435' \
  --data-urlencode 'bulk[1][awb_no]=86983175113435'
```

## Response

### Response L1

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `api_status` | string(10) | Validation result | (Refer to [Appendix I](https://developers.easyparcel.com/sg/marketplace/appendix/api-return-status.md)) |
| `error_code` | int(5) | Error code | (Refer to [Appendix I](https://developers.easyparcel.com/sg/marketplace/appendix/api-return-status.md)) |
| `error_remark` | string(100) | Error message | (Refer to [Appendix I](https://developers.easyparcel.com/sg/marketplace/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 tracking. | (Refer to [Response L3](#response-l3) & [Response L4](#response-l4)) |
| `latest_status` | string(45) | The status of the shipment. |  |
| `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. |  |
| `sender` | string(45) | The name of the sender |  |
| `receiver` | string(45) | The name of the receiver |  |

### Response L4 · `status_list` {#response-l4}

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `event_date` | date | Show date. |  |
| `event_time` | time | Show time. |  |
| `status` | string(150) | The status of the shipment. |  |
| `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-12-27",
          "event_time":"11:40 AM",
          "status":"Delivered",
          "location":"Demo"
        },
        "status":"",
        "sender":"xxxxxx",
        "receiver":"xxxxxx"
      },
      "latest_status":"Deliverd",
      "latest_update":"2017-12-27",
      "awb":"86983175113435"
    },
    {
      "status_list":{
        "0":{
          "event_date":"2017-12-27",
          "event_time":"11:40 AM",
          "status":"Delivered",
          "location":"Demo"
        },
        "status":"",
        "sender":"xxxxxx",
        "receiver":"xxxxxx"
      },
      "latest_status":"Deliverd",
      "latest_update":"2017-12-27",
      "awb":"86983175113435"
    }
  ]
}
```

### Fail

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

## Referenced appendices

Copied from the appendix pages linked above.

### Appendix I: API Return Status

Source: https://developers.easyparcel.com/sg/marketplace/appendix/api-return-status.md

| api_status | error_code | error_remark |
| --- | --- | --- |
| Error | 3 | Required api key |
| Error | 4 | Invalid api key |
| Error | 5 | Unauthorized user |
| Success | 0 |  |

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

Published by EasyParcel Singapore Pte Ltd (201605202W). GST No: 201605202W.
