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

# Domestic Express Order

> EasyParcel API · Malaysia · MarketPlace · version 1.4.0.0
> Page: https://developers.easyparcel.com/my/marketplace/domestic-express-order · Markdown: https://developers.easyparcel.com/my/marketplace/domestic-express-order.md · PDF: https://developers.easyparcel.com/pdf/Malaysia_MarketPlace_1.4.0.0.pdf

This endpoint is designed to direct create order + payment at EasyParcel. Currently it is limited within Domestic (Malaysia) shipping delivery.

## Endpoint

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

## 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. |
| `courier` | array | Yes | Courier List : 'Poslaju', 'Skynet', 'Nationwide', 'ABX', 'DHL eCommerce', 'Aramex', 'CJ Century', 'UTS', 'ULTIMATE CONSOLIDATORS' If the first courier is not available, it will select the next available courier in the array |
| `dropoff` | int(1) | Optional | Require for dropoff service. Value: 0,1  (e.g, 1 = true/ 0 =false\[Default \]) |
| `bulk` | array | Yes | (Refer to [Request L2](#request-l2)) |

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

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `referrence` | string | Yes | Require identifier of vendor’s order |
| `weight` | double(8,2) | Yes | The weight of the parcel. |
| `content` | string(35) | Yes | The content of the parcel. |
| `value` | double(8,2) | Yes | The amount of the items. |
| `pick_name` | string(35) | Yes | Sender's name. |
| `pick_company` | string(35) | Optional | Sender's company. |
| `pick_contact` | string(16) | Yes | Sender's contact. |
| `pick_mobile` | string(16) | Optional | Sender's mobile. |
| `pick_addr1` | string(35) | Yes | Sender's address line 1. |
| `pick_addr2` | string(35) | Optional | Sender's address line 2. |
| `pick_addr3` | string(35) | Optional | Sender's address line 3. |
| `pick_addr4` | string(35) | Optional | Sender's address line 4. |
| `pick_city` | string(35) | Yes | Sender's city. |
| `pick_state` | string(35) | Yes | Sender’s state. (Refer to [Appendix III](https://developers.easyparcel.com/my/marketplace/appendix/state-code-list.md)) |
| `pick_code` | string(10) | Yes | Sender's postcode. |
| `pick_country` | string(35) | Yes | Sender's country. Refer to ISO 3166-2 |
| `send_name` | string(35) | Yes | Receiver's name. |
| `send_contact` | string(16) | Yes | Receiver's contact. |
| `send_mobile` | string(16) | Optional | Receiver's mobile. |
| `send_addr1` | string(35) | Yes | Receiver's address line 1. |
| `send_addr2` | string(35) | Optional | Receiver's address line 2. |
| `send_addr3` | string(35) | Optional | Receiver's address line 3. |
| `send_addr4` | string(35) | Optional | Receiver's address line 4. |
| `send_city` | string(35) | Yes | Receiver's city. |
| `send_state` | string(35) | Yes | Receiver’s state. (Refer to [Appendix III](https://developers.easyparcel.com/my/marketplace/appendix/state-code-list.md)) |
| `send_code` | string(10) | Yes | Receiver's postcode. |
| `send_country` | string(35) | Yes | Receiver's country. Refer to ISO 3166-2 |
| `collect_date` | date | Yes | Check the available pickup date. If didn't put the date,today date will be default. Format : “YYYY-MM-DD” |
| `send_email` | string | Yes | Receiver’s email. |
| `sms` | boolean | Optional | Require for sms feature, Value: 0,1 (e.g, 1 = true/ 0 =false\[Default\]) |

## Sample code

### PHP

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

$action = "EPSubmitOrderBulkV3";
$postparam = array(
    'authentication'=> 'xxxxxx',
    'api' => 'xxxxxx',
    'courier' => array('Poslaju'),
    'dropoff' => '0',
    'bulk' => array(
        array(
            'referrence' => 'item1',
            'weight' => '1',
            'content' => '2017-09-14 - book',
            'value' => '20',
            'pick_name' => 'Yong Tat',
            'pick_company' => 'Yong Tat Sdn Bhd',
            'pick_contact' => '+6012-1234-5678',
            'pick_mobile' => '+6017-1234-5678',
            'pick_addr1' => 'ppppp46/7 adfa',
            'pick_addr2' => 'test',
            'pick_addr3' => 'test',
            'pick_addr4' => '',
            'pick_city' => 'png',
            'pick_state' => 'png',
            'pick_code' => '14300',
            'pick_country' => 'MY',
            'send_name' => 'Sam',
            'send_contact' => '+6012-2134567',
            'send_mobile' => '+6017-1234-5678',
            'send_addr1' => 'ssssadsasdst test',
            'send_addr2' => 'test test',
            'send_addr3' => 'test',
            'send_addr4' => '',
            'send_city' => 'png',
            'send_state' => 'png',
            'send_code' => '11950',
            'send_country' => 'MY',
            'collect_date' => '2020-03-16',
            'send_email' => 'xxxxxx@hotmail.com',
            'sms' => '0',
        ),
    ),
);

$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=EPSubmitOrderBulkV3' \
  --data-urlencode 'authentication=xxxxxx' \
  --data-urlencode 'api=xxxxxx' \
  --data-urlencode 'courier[0]=Poslaju' \
  --data-urlencode 'dropoff=0' \
  --data-urlencode 'bulk[0][referrence]=item1' \
  --data-urlencode 'bulk[0][weight]=1' \
  --data-urlencode 'bulk[0][content]=2017-09-14 - book' \
  --data-urlencode 'bulk[0][value]=20' \
  --data-urlencode 'bulk[0][pick_name]=Yong Tat' \
  --data-urlencode 'bulk[0][pick_company]=Yong Tat Sdn Bhd' \
  --data-urlencode 'bulk[0][pick_contact]=+6012-1234-5678' \
  --data-urlencode 'bulk[0][pick_mobile]=+6017-1234-5678' \
  --data-urlencode 'bulk[0][pick_addr1]=ppppp46/7 adfa' \
  --data-urlencode 'bulk[0][pick_addr2]=test' \
  --data-urlencode 'bulk[0][pick_addr3]=test' \
  --data-urlencode 'bulk[0][pick_addr4]=' \
  --data-urlencode 'bulk[0][pick_city]=png' \
  --data-urlencode 'bulk[0][pick_state]=png' \
  --data-urlencode 'bulk[0][pick_code]=14300' \
  --data-urlencode 'bulk[0][pick_country]=MY' \
  --data-urlencode 'bulk[0][send_name]=Sam' \
  --data-urlencode 'bulk[0][send_contact]=+6012-2134567' \
  --data-urlencode 'bulk[0][send_mobile]=+6017-1234-5678' \
  --data-urlencode 'bulk[0][send_addr1]=ssssadsasdst test' \
  --data-urlencode 'bulk[0][send_addr2]=test test' \
  --data-urlencode 'bulk[0][send_addr3]=test' \
  --data-urlencode 'bulk[0][send_addr4]=' \
  --data-urlencode 'bulk[0][send_city]=png' \
  --data-urlencode 'bulk[0][send_state]=png' \
  --data-urlencode 'bulk[0][send_code]=11950' \
  --data-urlencode 'bulk[0][send_country]=MY' \
  --data-urlencode 'bulk[0][collect_date]=2020-03-16' \
  --data-urlencode 'bulk[0][send_email]=xxxxxx@hotmail.com' \
  --data-urlencode 'bulk[0][sms]=0'
```

## Response

### Response L1

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

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

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `summary` | object | Summary of Result | (Refer to [Response L3](#response-l3)) |
| `success` | array | Success order | (Refer to [Response L4](#response-l4)) |
| `fail` | array | Fail order with reason | (Refer to [Response L5](#response-l5)) |

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

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `courier_service` | array | The response of courier selected from order |  |
| `orders_number` | array | The response of the order number placed. |  |
| `total_paid_amount` | double(8,2) | Total of order price |  |
| `total_success` | int | Total of success order |  |
| `total_fail` | int | Total of fail order |  |

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

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `referrence` | string | The reference pass back from Request |  |
| `status` | string | The status of the orders made. |  |
| `remarks` | string | The error message for orders made. |  |
| `order_number` | string | The response of the order number placed. |  |
| `courier` | string | The response of the courier full name |  |
| `courier_short` | string | The response of the courier shot name |  |
| `price` | double(8,2) | shipping price of this parcel | shipping + tax + addon |
| `tax` | double(8,2) | tax amount |  |
| `addon_price` | double(8,2) | add on price | Setting on easyparcel website - marketing tools |
| `parcel_number` | string | The response of the parcel number placed. |  |
| `awb` | string | Airway bill number / Tracking Number |  |
| `awb_id_link` | string | PDF link of Airway bill number. | consignment note |
| `tracking_url` | string | Link of tracking url. |  |

### Response L5 · `fail` {#response-l5}

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `referrence` | string | The reference pass back from Request |  |
| `status` | string | The status of the orders made. |  |
| `remarks` | string | The error message for orders made. |  |

## Response samples

### Success

```json
{
  "api_status":"Success",
  "error_code":0,
  "error_remark":"",
  "result":{
    "summary":{
      "courier_service":[
        "POSLAJU NATIONAL COURIER"
      ],
      "orders_number":[
        "EI-5UF8T"
      ],
      "total_paid_amount":"8.15",
      "total_success":1,
      "total_fail":0
    },
    "success":[
      {
        "referrence":"item1",
        "status":"Success",
        "remarks":"Order Successfully Placed And Paid.",
        "order_number":"EI-5UF8T",
        "courier":"POSLAJU NATIONAL COURIER",
        "courier_short":"Pos Laju",
        "price":"8.00",
        "tax":"0.00",
        "addon_price":"0.15",
        "parcel_number":"EP-PXUIB",
        "awb":"ER665997516MY",
        "awb_id_link":"http:\/\/demo.connect.easyparcel.my\/?ac=AWBLabel&id=b0VYQjhEMW4jMTc0OTc4MzA%3D",
        "tracking_url":"https:\/\/easyparcel.com\/my\/en\/track\/details\/?courier=Poslaju&awb=ER665997516MY"
      }
    ],
    "fail":[
      
    ]
  }
}
```

### Fail

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

## Referenced appendices

Copied from the appendix pages linked above.

### Appendix III: State Code List

Source: https://developers.easyparcel.com/my/marketplace/appendix/state-code-list.md

| Short State Name | Full State Name |
| --- | --- |
| jhr | Johor |
| kdh | Kedah |
| ktn | Kelantan |
| mlk | Melaka |
| nsn | Negeri Sembilan |
| phg | Pahang |
| prk | Perak |
| pls | Perlis |
| png | Pulau Pinang |
| sgr | Selangor |
| trg | Terengganu |
| kul | Kuala Lumpur |
| pjy | Putra Jaya |
| srw | Sarawak |
| sbh | Sabah |
| lbn | Labuan |

### Appendix I: API Return Status

Source: https://developers.easyparcel.com/my/marketplace/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).
