0% found this document useful (0 votes)
292 views51 pages

Easyparcel Marketplace Api Documentation V3.0.0

The EasyParcel API documentation provides information on rate checking and other parcel shipping functions. It details 14 sections covering topics like getting rates, placing orders, tracking shipments, and more. Each section includes the URL, request format, response values, and code samples to integrate the APIs. Authentication is required using an API key for all requests.

Uploaded by

anon_448388059
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
292 views51 pages

Easyparcel Marketplace Api Documentation V3.0.0

The EasyParcel API documentation provides information on rate checking and other parcel shipping functions. It details 14 sections covering topics like getting rates, placing orders, tracking shipments, and more. Each section includes the URL, request format, response values, and code samples to integrate the APIs. Authentication is required using an API key for all requests.

Uploaded by

anon_448388059
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

EASYPARCEL MARKETPLACE API

DOCUMENTATION v3.0.0
EasyParcel API Documentation v3.0.0

No Content Page

1 Overview 3

2 Base URL 3

3 Getting an API key 3

4 Authentication 3

5 Rate Checking 4 - 10
5.1 - URL
5.2 - HTTP post request
5.3 - Response / Return value
5.4 - Sample Code

6 Making Order 11 - 13
6.1 - URL
6.2 - HTTP post request
6.3 - Response / Return value
6.4 - Sample Code

7 Making Order Payment 14 - 20


7.1 - URL
7.2 - HTTP post request
7.3 - Response / Return value
7.4 - Sample Code

8 Checking Order Status 21 - 24


8.1 - URL
8.2 - HTTP post request
8.3 - Response / Return value
8.4 - Sample Code

9 Checking Parcel Status 25 - 29


9.1 - URL
9.2 - HTTP post request
9.3 - Response / Return value
9.4 - Sample Code

10 Tracking Parcel Details 30 - 33


10.1 - URL
10.2 - HTTP post request
10.3 - Response / Return value
10.4 - Sample Code

11 Credit Checking 34 - 37
10.1 - URL
10.2 - HTTP post request
10.3 - Response / Return value
10.4 - Sample Code

12 Market Rate Checking 38 - 42


12.1 - URL
12.2 - HTTP post request
12.3 - Response / Return value
12.4 - Sample Code

13 User Sign Up 43 - 46
13.1 - URL
13.2 - HTTP post request
13.3 - Response / Return value
13.4 - Sample Code

Page 1
EasyParcel API Documentation v3.0.0

13 Appendix I (API Return Status) 48

14 Appendix II (Country Code List) 48

15 Appendix III (State Code List) 48

16 Appendix IV (Sample UI/UX) 49-50

Page 2
EasyParcel API Documentation v3.0.0

1.0 Overview
The EasyParcel API allows your application to access current data within EasyParcel. However, EasyParcel API is using
RESTful with PHP concept to develop API for web based applications. Through the API, several common operations can
be performed on EasyParcel objects. There are 7 sections which consists of:
➔ Rate Checking ➔ Check Order Status
➔ Normal Rate Checking ➔ Check Parcel Status
➔ Making Order ➔ Check Parcel Details
➔ Making Order Payment ➔ Check Credit Balance

2.0 Base URL


All API URLs start with the following base part:
For Demo : http://demo.connect.easyparcel.my/
For Live : http://connect.easyparcel.my/

Demo URL is only for testing purposes.


Live URL is for real live transaction usage.

3.0 Getting an API key


An API key is required to build an application using our API. Here's how to get an API key:
1. Sign up an EasyParcel account at www.easyparcel.my.
2. Complete the account verification.
3. Register the key for API access.

4.0 Authentication
In order for an application to access the API, it needs to have a valid access token. The token is generated when
EasyParcel grants the application access to their account. The application needs to use it for each API call to the
resources. API keys carry many privileges, so be sure to keep them secret. EasyParcel expects for the API key to be
included in all requests.

Page 3
EasyParcel API Documentation v3.0.0

5.0 Rate Checking

Page 4
EasyParcel API Documentation v3.0.0

5.0 Rate Checking API


This enable rate checking from all courier companies in EasyParcel platform. User need to provide sender and receiver
address to check the shipment rate.

5.1 URL
For Live : http://connect.easyparcel.my/?ac=MPRateChecking
For Demo : http://demo.connect.easyparcel.my/?ac=MPRateChecking

5.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
pick_code string(10) Yes Sender's postcode.
pick_state string(35) Yes Sender's state. (Refer to Appendix III)
pick_country string(2) Yes Sender's country (“MY”).
send_code string(10) Yes Receiver's postcode.
send_state string(35) Yes Receiver's state. (Refer to Appendix III)
send_country string(2) Yes Receiver's country (“MY”).
weight double(8,2) Yes The weight of the parcel.
width double(8,2) Optional The width of the parcel.
length double(8,2) Optional The length of the parcel.
height double(8,2) Optional The height of the parcel.
date_coll date Optional Check the available pickup date. If the date is left empty, the default will be
today’s date.
Format : “YYYY-MM-DD”

5.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
rates array The response of the rate checking (Refer to Table 5.3.1)
pgeon_point array Available pgeon point of the rate checking (Refer to Table 5.3.2)
status string(10) The status of the rate checking. Fail / Success
remarks string(100) The error message for rate checking.
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

Page 5
EasyParcel API Documentation v3.0.0

5.3.1 Success Response/ Return Value (rates)


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
Service_ID string (15) Service ID
Service_Name string (100) Service name
Service_Type string (10) Type of service parcel/ document
Courier_ID string (10) Courier ID
Courier_Name string (100) Courier name
Courier_Logo string (300) Courier logo
scheduled_start_date string (50) Scheduled pickup for parcel.
Pickup_date date The date to pickup the parcel. Same day pickup only
available before 12pm.
Delivery string (100) The day(s) to deliver the parcel.
Price double(8,2) Booking price.
Dropoff_Point array Drop-off point for it’s courier service (Refer to Table 5.3.1.1)

5.3.1.1 Success Response/Return Value (Dropoff_Point)


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
point_id string(25) Drop-off point ID
point_name string(100) Drop-off point name
point_contact string(10) Drop-off point contact
point_addr1 string(10) Drop-off point address line 1
point_addr2 string(10) Drop-off point address line 2
point_addr3 string(10) Drop-off point address line 3
point_addr4 string(10) Drop-off point address line 4
point_postcode string(10) Drop-off point postcode
point_city string(10) Drop-off point city
point_state string(10) Drop-off point state (Refer to Appendix III)
price double(8,2) Drop-off point fee

5.3.2 Success Response/ Return Value (​pgeon_point​)


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
Sender_point array Pgeon Point near sender address (Refer to Table 5.3.2.1)
Receiver_point array Pgeon Point near Receiver address (Refer to Table 5.3.2.1)

Page 6
EasyParcel API Documentation v3.0.0

5.3.2.1 Success Response/Return Value (​Sender_point & Receiver_point​)


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
point_id string(25) Drop-off point ID
company string(100) Drop-off point company
point_name string(100) Drop-off point name
point_contact string(10) Drop-off point contact
point_addr1 string(10) Drop-off point address line 1
point_addr2 string(10) Drop-off point address line 2
point_addr3 string(10) Drop-off point address line 3
point_addr4 string(10) Drop-off point address line 4
point_postcode string(10) Drop-off point postcode
point_city string(10) Drop-off point city
point_state string(10) Drop-off point state (Refer to Appendix III)
price double(8,2) Drop-off point Booking fee

Page 7
EasyParcel API Documentation v3.0.0

5.4 Sample Code


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

$action = "MPRateChecking";
$postparam = array(
'authentication' => 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxxxx',
'pick_code' => "53100",
'pick_state' => "kul",
'pick_country' => "MY",
'send_code' => "11950",
'send_state' => "png",
'send_country' => "My",
'weight' => 1,
'width' => 0,
'length' => 0,
'height' => 0,
'date_coll' => date("Y-m-d")
);

$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>";
?>

Page 8
EasyParcel API Documentation v3.0.0

Figure 5.4.1: Error Result


{
"access":"Invalid authentication key.",
"rates":[

],
"api_status":"Error",
"error_code":"2",
"error_remark":"Invalid authentication key"
}

Page 9
EasyParcel API Documentation v3.0.0

Figure 5.4.2: Success Result


{
"rates":[
{
"Service_ID":"EP-CS0N",
"Service_Name":"Next Day Delivery Service",
"Service_Type":"document",
"Courier_ID":"EP-CR05",
"Courier_Name":"Skynet",
"Courier_Logo":"https:\/\/fanyv88.com:443\/http\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/SKYNET-EXPRESS.png",
"scheduled_start_date":"2017-07-03 Monday",
"Pickup_date":"2017-07-03",
"Delivery":"Estimated 1 working day(s)",
"Price":"7.80",
"Dropoff_Point":[
{
"point_id":"SKYNET_AKH",
"point_name":"SKYNET AYER KEROH",
"point_contact":"62316898",
"point_addr1":"SKYNET WORLDWIDE (MELAKA) SDN BHD",
"point_addr2":"653-O, Jalan Delima 3,",
"point_addr3":"Taman Bukit Melaka",
"point_addr4":"",
"point_postcode":"75450",
"point_city":"Bukit Beruang",
"point_state":"mlk",
"price":0
}
]
}
],
"pgeon_point":{
"Sender_point":[
{
"point_id":"PGEON_P_SA",
"company":"myNews",
"point_name":"SACC (48)",
"point_contact":"355108682",
"point_lat":"3.074945",
"point_lon":"101.5184498",
"point_addr1":"LOT LGF 02 & LGF 03, LOWER GROUND FLR,",
"point_addr2":"SACC SHOPPING COMPLEX,",
"point_addr3":"",
"point_addr4":"",
"point_city":"SHAH ALAM",
"point_state":"sgr",
"point_postcode":"40000",
"price":"0.00"
},
"Receiver_point":[
]
},
"status":"Success",
"remarks":"",
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Page 10
EasyParcel API Documentation v3.0.0

6.0 MAKING ORDER

Page 11
EasyParcel API Documentation v3.0.0

6.0 Making Order


The authenticated user can make single order at EasyParcel. User need to make sure the courier service is available.

6.1 URL
For Live : http://connect.easyparcel.my/?ac=MPSubmitOrder
For Demo : http://demo.connect.easyparcel.my/?ac=MPSubmitOrder

6.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
weight double(8,2) Yes The weight of the parcel.
width double(8,2) Optional The width of the parcel.
length double(8,2) Optional The length of the parcel.
height double(8,2) Optional The height of the parcel.
content string(35) Yes The content of the parcel.
value double(8,2) Yes The amount of the items.
service_id string(10) Yes Obtain from MPRateChecking return value.
collect_date date Yes Check the available pickup date. If didn't put the date,today date will be default.
Format : “YYYY-MM-DD”
pick_point string(35) Yes / Optional Obtain from MPRateChecking return value (point_id) from pgeon_point or
(point_id) from Dropoff_Point.
This field is required only when you choose for Pgeon Express and must
choose from Sender_point.
pick_name string(35) Yes Sender's name.
pick_company string(30) Optional Sender's company.
pick_mobile string(16) Optional Sender's mobile.
pick_contact string(16) Yes Sender's contact.
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_code string(10) Yes Sender's postcode.
pick_city string(35) Yes Sender's city.
pick_country string(35) Yes Sender's country. (Refer to Appendix II)
send_point string(35) Yes / Optional Obtain from MPRateChecking return value (point_id) from pgeon_point
This field is required only when you choose for Pgeon Express and must
choose from Receiver_point.
send_name string(35) Yes Receiver's name.
send_company string(30) Optional Receiver's company.
send_mobile string(16) Optional Receiver's mobile.
send_contact string(16) Yes Receiver's contact.

Page 12
EasyParcel API Documentation v3.0.0

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_code string(10) Yes Receiver's postcode.
send_city string(35) Yes Receiver's city.
send_country string(35) Yes Receiver's country. (Refer to Appendix II)

6.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
status string(10) The status of the orders made. Fail / Success
remarks string(100) The error message for orders made.
order_number string(12) The response of the order placed. Failed = 0
Success = (order_number)
price double(8,2) Order price
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

Page 13
EasyParcel API Documentation v3.0.0

6.4 Sample Code


<?php

$domain = "http://demo.connect.easyparcel.my/?ac=";

$action = "MPSubmitOrder";
$postparam = array(
'authentication' => 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxxxx',

'weight'=> 1.00,
'width'=> 0,
'length'=> 0,
'height'=> 0,

'content'=> "book",
'value'=> 20,
'service_id'=> "EP-CR0A",

'pick_name'=> "Yong Tat",


'pick_company'=>"Yong Tat Sdn Bhd",
'pick_mobile'=> "",
'pick_contact'=> "+6568505280",
'pick_unit'=> "30",
'pick_code'=> "059892",
'pick_country'=> "SG",

'send_name'=> "Sam",
'send_company'=>"",
'send_mobile'=> "",
'send_contact'=> "+60-0178320239",
'send_unit'=> "12",
'send_code'=> "119916",
'send_country'=> "SG",

'collect_date'=> "2016-12-16"
);

$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>";
?>

Page 14
EasyParcel API Documentation v3.0.0

Figure 6.4.1: Error Result


{
"access":"Invalid authentication key.",
"status":"",
"remarks":"",
"order_number":"",
"price":"",
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Figure 6.4.2: Success Result


{
"access":"Valid authentication and api key.",
"status":"success",
"remarks":"Order Successfully Placed",
"order_number":"EI-000QD",
"price":"7.30",
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 15
EasyParcel API Documentation v3.0.0

7.0 MAKING ORDER PAYMENT

Page 16
EasyParcel API Documentation v3.0.0

7.0 Making Order Payment


This step involves payment for the orders made. The authenticated user can do single order payment. Single order
payment refers to payment for a single parcel only. There are various payment conditions that may appear such as
insufficient credit (when user’s account do not have sufficient credit to perfom payment), sufficient credit (when there are
sufficient credit for payment) and etc.

7.1 URL
For Live : http://connect.easyparcel.my/?ac=MPPayOrder
For Demo : http://demo.connect.easyparcel.my/?ac=MPPayOrder

7.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
order_no string(15) Yes Acquire from the order that placed.

7.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
status array The response of the make order payment (Refer to Table 7.3.1)
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

7.3.1 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
array The result after making payment (Refer to Table 7.3.2)

7.3.2 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
orderno string (15) Valid order number. Valid and authenticated.
messagenow string (50) The message that shows the status of order.
parcel array The details of the parcel. (Refer to Table 7.3.3)

Page 17
EasyParcel API Documentation v3.0.0

7.3.3 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
parcelno string (15) Parcel number.
awb string (45) Airway bill number.
awb_id_link string (300) Link of airway bill ID.

Page 18
EasyParcel API Documentation v3.0.0

7.4 Sample Code


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

$action = "MPPayOrder";
$postparam = array(
'authentication'=> 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxx',
'order_no'=>"EI-000QD",
);

$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>";
?>

Page 19
EasyParcel API Documentation v3.0.0

Figure 7.4.1: Error Result


{
"access":"Invalid authentication key.",
"status":[

],
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Figure 7.4.2: Success Result


{
"access":"Valid authentication and api key."
"status":[
{
"orderno":"EI-000QD",
"messagenow":"Payment Done",
"parcel":[
{
"parcelno":"EP-00049",
"awb":"86983158113435",
"awb_id_link":"https:\/\/fanyv88.com:443\/http\/demo.connect.easyparcel.my\/?ac=AWBLabel&id=RVAtWVZ0WlNvc2pPIzQ0NQ%3D%3D"
}
]
}
],
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 20
EasyParcel API Documentation v3.0.0

8.0 CHECKING ORDER STATUS

Page 21
EasyParcel API Documentation v3.0.0

8.0 Checking order status


Get order status by using order number is the recommended call to use for management. Use this call to retrieve all orders
in which the authenticated caller.

8.1 URL
For Live : http://connect.easyparcel.my/?ac=MPOrderStatus
For Demo : http://demo.connect.easyparcel.my/?ac=MPOrderStatus

8.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
order_no string(15) Yes Acquire from the order placed earlier.

8.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
param string(20) Title for order status api
result array The result for order status, if status is Success (Refer to Table 8.3.1)
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

8.3.1 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
Order_Status string(25) The status of your order. ● Cancel
● Waiting Payment
● Paid
● Partial Payment
● Undefined Status
Order_Payable string(10) The order that can pay. True / False
Status string(10) The status of the orders made. Fail / Success.
Remarks string(100) The message for orders made.
Order_no string(15) Order number.

Page 22
EasyParcel API Documentation v3.0.0

8.4 Sample Code


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

$action = "MPOrderStatus";
$postparam = array(
'authentication'=> 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxx',
'order_no'=>"EI-000QD",
);

$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>";
?>

Page 23
EasyParcel API Documentation v3.0.0

Figure 8.4.1: Error Result


{
"access":"Invalid authentication key.",
"param":"Order_Status",
"result":[

],
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Figure 8.4.2: Success Result


{
"access":"Valid authentication and api key."
"param":"Order_Status",
"result":{
"Order_Status":"Paid",
"Order_Payable":"false",
"Status":"Success",
"Remarks":"Correct Order_no",
"Order_no":"EI-000QD"
},
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 24
EasyParcel API Documentation v3.0.0

9.0 CHECKING PARCEL STATUS

Page 25
EasyParcel API Documentation v3.0.0

9.0 Checking parcel status


Get parcel status by using order number is the recommended call to use for checking the shipment. Use this call to retrieve
parcel details.

9.1 URL
For Live : http://connect.easyparcel.my/?ac=MPParcelStatus
For Demo : http://demo.connect.easyparcel.my/?ac=MPParcelStatus

9.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
order_no string(15) Yes Acquire from the order placed.

9.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
param string(20) Title for order status api
result array The result for parcel status, if status is Success (Refer to Table 9.3.1)
status string(10) The status of the orders made.
remarks string(100) The message for orders made.
order_no string(15) Order number.
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

Page 26
EasyParcel API Documentation v3.0.0

9.3.1 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
array The result for parcel status. (Refer to Table 9.3.2)

9.3.2 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
Parcel_Number string(15) The number of the parcel.
Ship_Status string(45) The status of the shipment. ● Cancel
● Waiting Payment
● Pending For Collection
● Collected
● Returned
● Delivering(in transit)
● Successfully Delivered
● Schedule In
Arrangement
● On Hold
● Expired (Unpaid)
● Cancel By Admin
● Drop Off
● Other Status
Airway-Bill string(45) Airway bill number. Empty if null.
Airway-Bill-Link string(300) The URL link of the Airway bill Downloadable PDF file

Page 27
EasyParcel API Documentation v3.0.0

9.4 Sample Code


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

$action = "MPParcelStatus";
$postparam = array(
'authentication'=> 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxx',
'order_no'=>"EI-000QD",
);

$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>";
?>

Page 28
EasyParcel API Documentation v3.0.0

Figure 9.4.1: Error Result


{
"access":"Invalid authentication key.",
"param":"Parcel_Status",
"result":[

],
"status":"",
"remarks":"",
"order_no":"",
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Figure 9.4.2: Success Result


{
"access":"Valid authentication and api key."
"param":"Parcel_Status",
"result":[
{
"Parcel_Number":"EP-00049",
"Ship_Status":"Schedule In Arrangement",
"Airway-Bill":"86983158113435",
"Airway-Bill-Link":"https:\/\/fanyv88.com:443\/http\/demo.connect.easyparcel.my\/?ac=AWBLabel&id=RVAtWVZ0WlNvc2pPIzQ0NQ%3D%3D"
}
],
"status":"Success",
"remarks":"Correct Order_no",
"order_no":"EI-000QD",
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 29
EasyParcel API Documentation v3.0.0

10.0 TRACKING PARCEL DETAILS

Page 30
EasyParcel API Documentation v3.0.0

10.0 Tracking Parcel Details


Track the shipment status using airway bill number.

10.1 URL
For Live : http://connect.easyparcel.my/?ac=MPTracking
For Demo : http://demo.connect.easyparcel.my/?ac=MPTracking

10.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
awb_no string(25) Yes Generate automatically after the payment.

10.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
status_list array The result for tracking. (Refer to Table 10.3.1-
10.3.3)
latest_status string(45) The status of the shipment.
latest_update string(45) Show the date and time.
awb string(45) Airway bill number.
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

10.3.1 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
array The result for tracking. (Refer to Table 10.3.4)
status string(45) The status of the shipment.

10.3.2 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
event_date date Show date and time.
status string(150) The status of the shipment.
location string(100) Track the location of the parcel.

Page 31
EasyParcel API Documentation v3.0.0

10.4 Sample Code


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

$action = "MPParcelStatus";
$postparam = array(
'authentication'=> 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxx',
'awb_no'=>"86983158113435"
);

$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>";
?>

Page 32
EasyParcel API Documentation v3.0.0

Figure 10.4.1: Error Result


{
"access":"Invalid authentication key.",
"status_list":[

],
"latest_status":"",
"latest_update":"",
"awb":"",
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Figure 10.4.2: Success Result


{
"access":"Valid authentication and api key."
"status_list":{
"0":{
"event_date":"2016-11-04",
"event_time":"09:42 AM",
"status":"Delivered 04 Nov 2016 13:00",
"location":"Penang"
},
"1":{
"event_date":"2016-11-03",
"event_time":"09:41 AM",
"status":"With delivery courier",
"location":"Penang"
}
"status":"Delivered \/ Returned",
"sender":"XXXXXXXX",
"receiver":"XXXXXXX"
},
"latest_status":"Delivered 04 Nov 2016 13:00",
"latest_update":"2016-11-04",
"awb":"86983158113435",
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 33
EasyParcel API Documentation v3.0.0

11.0 CHECK CREDIT BALANCE

Page 34
EasyParcel API Documentation v3.0.0

11.0 Check Credit Balance


This allow you check currently user balance.

11.1 URL
For Live : http://connect.easyparcel.my/?ac=EPCheckCreditBalance
For Demo : http://demo.connect.easyparcel.my/?ac=EPCheckCreditBalance

11.2 HTTP POST Request


Name Type Required Description
api string(25) Yes Obtain from registered account.

11.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
credit double(8,2) Account Balance
api_status string(10) API execute status (Refer to Appendix I)
error_code int(5) API error code (Refer to Appendix I)
error_remark string(100) API error remarks (Refer to Appendix I)

Page 35
EasyParcel API Documentation v3.0.0

11.4 ​Sample Code


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

$action = "EPCheckCreditBalance";
$postparam = array(
‘api’ => 'xxxxxxxxxxxx'

);

$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>";
?>

Page 36
EasyParcel API Documentation v3.0.0

Figure 4.4.1: Error Result


{
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Figure 4.4.2: Success Result


{
"credit":"25.00",
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 37
EasyParcel API Documentation v3.0.0

12.0 Market Rate Checking

Page 38
EasyParcel API Documentation v3.0.0

12.0 Market Rate Checking API


This enable market rate checking from all courier companies in EasyParcel platform. User need to provide sender and
receiver address to check the market rate.

12.1 URL
For Live : http://connect.easyparcel.my/?ac=MPNormalRateChecking
For Demo : http://demo.connect.easyparcel.my/?ac=MPNormalRateChecking

12.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
api string(25) Yes Obtain from registered account.
pick_code string(10) Yes Sender's postcode.
pick_country string(2) Yes Sender's country (“SG”).
send_code string(10) Yes Receiver's postcode.
send_country string(2) Yes Receiver's country (“SG”).
weight double(8,2) Yes The weight of the parcel.
width double(8,2) Optional The width of the parcel.
length double(8,2) Optional The length of the parcel.
height double(8,2) Optional The height of the parcel.
date_coll date Optional Check the available pickup date. If the date is left empty, the default will be
today’s date.
Format : “YYYY-MM-DD”

12.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
rates array The response of the rate checking (Refer to Table 12.3.1)
status string(10) The status of the rate checking. Fail / Success
remarks string(100) The error message for rate checking.
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

Page 39
EasyParcel API Documentation v3.0.0

12.3.1 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
array The result rate checking. (Refer to Table 12.3.2)

12.3.2 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
Service_ID string (15) Service ID
Service_Name string (100) Service name
Service_Type string (10) Type of service parcel/ document
Courier_ID string (10) Courier ID
Courier_Name string (100) Courier name
Courier_Logo string (300) Courier logo
scheduled_start_date string (50) Scheduled pickup for parcel.
Pickup_date date The date to pickup the parcel. Same day pickup only
available before 12pm.
Delivery string (100) The day(s) to deliver the parcel.
Price double(8,2) Booking price.

Page 40
EasyParcel API Documentation v3.0.0

12.4 Sample Code


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

$action = "MPNormalRateChecking";
$postparam = array(
'authentication' => 'xxxxxxxxxxxx',
'api' => 'xxxxxxxxxxxx',
'pick_code' => "059893",
'pick_country' => "SG",
'send_code' => "059897",
'send_country' => "SG",
'weight' => 10,
'width' => 0,
'length' => 0,
'height' => 0,
'date_coll' => date("Y-m-d")
);

$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>";
?>

Figure 12.4.1: Error Result


{
"access":"Invalid authentication key.",
"rates":[

],
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}

Page 41
EasyParcel API Documentation v3.0.0

Figure 12.4.2: Success Result


{
"access":"Valid authentication and api key."
"rates":[
{
"Service_ID":"EP-CS0F",
"Service_Name":"Standard Delivery",
"Service_Type":"parcel",
"Courier_ID":"EP-CR0D",
"Courier_Name":"Roadbull",
"Courier_Logo":"https:\/\/fanyv88.com:443\/http\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/Roadbull.png",
"scheduled_start_date":"2016-12-15 Thursday",
"Pickup_date":"2016-12-15",
"Delivery":"Estimated 1 working day(s)",
"Price":"7.50"
},
{
"Service_ID":"EP-CS0D",
"Service_Name":"Next Day Pick Up Service",
"Service_Type":"parcel",
"Courier_ID":"EP-CR0A",
"Courier_Name":"Nationwide",
"Courier_Logo":"https:\/\/fanyv88.com:443\/http\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/Nationwide-Express-logo.jpg",
"scheduled_start_date":"2016-12-16 Friday",
"Pickup_date":"2016-12-16",
"Delivery":"Estimated 1 working day(s)",
"Price":"14.30"
}
],
"status":"Success",
"remarks":"",
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 42
EasyParcel API Documentation v3.0.0

13.0 USER SIGN UP

Page 43
EasyParcel API Documentation v3.0.0

13.0 User Sign Up


Allow user using API to sign up EasyParcel account.

13.1 URL
For Live : http://connect.easyparcel.my/?ac=MPUserSignUp
For Demo : http://demo.connect.easyparcel.my/?ac=MPUserSignUp

13.2 HTTP POST Request


Name Type Required Description
authentication string(25) Yes Obtain from EasyParcel IT administrator
email string(100) Yes User email address.
first_name string(35) Yes User first name.
last_name string(35) Yes User last name.

13.3 Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
access string(150) Validate authentication and api
result array The result for user signup. (Refer to Table 13.3.1)
api_status string(10) Validation result (Refer to Appendix I)
error_code int(5) Error code (Refer to Appendix I)
error_remark string(100) Error message (Refer to Appendix I)

13.3.1 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
array The result for tracking. (Refer to Table 13.3.2)

13.3.2 Success Response/ Return Value


All APIs support an optional return format parameter format=json. Note that json is the default response format.
Return Value Type Description Remarks
status string(100) The status of the user signup.

Page 44
EasyParcel API Documentation v3.0.0

13.4 Sample Code


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

$action = "MPUserSignUp";
$postparam = array(
'authentication'=> 'xxxxxxxxxxxx',
'email'=>"[email protected]",
'first_name'=>"Calvin",
'last_name'=>"Tan"

);

$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>";
?>

Page 45
EasyParcel API Documentation v3.0.0

Figure 13.4.1: Error Result


{
"access":"Invalid authentication key.",
"result":[

],
"api_status":"Error",
"error_code":"2",
"error_remark":"Invalid authentication key"
}

Figure 13.4.2: Success Result


{
"access":"Valid authentication key.",
"result":[
{
"status":"[email protected] New user register"
}
],
"api_status":"Success",
"error_code":"0",
"error_remark":""
}

Page 46
EasyParcel API Documentation v3.0.0

APPENDIX

Page 47
EasyParcel API Documentation v3.0.0

Appendix I (API Return Status)


api_status error_code error_remark
Success 0
Error 1 Required authentication key
Error 2 Invalid authentication key
Error 3 Required api key
Error 4 Invalid api key
Error 5 Unauthorized user
Error 6 Invalid data insert format in array

Appendix II (Country Code List)


Short Country Name Full Country Name
MY Malaysia

Appendix III (State Code List)


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

Page 48
EasyParcel API Documentation v3.0.0

Appendix IV (Sample UI/UX)


After checkout page during entering delivering address, There will be a “Pgeon Click & Collect” button (as show below).

Page 49
EasyParcel API Documentation v3.0.0

Once you clike “Pgeon Click & Collect” It should pop up a map with all the Pgeon Point (as show below).

After user select the Pgeon point, The delivery address field should fill in the Pgeon point address.

Note: you could use google map api to enable the map feature and the map design could refer as below.
styles:
[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landsca
pe","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType"
:"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke
","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","styler
s":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"ligh
tness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21}]},{"featureType":"p
oi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","styl
ers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"
#333333"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementTyp
e":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","
stylers":[{"color":"#fefefe"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"c
olor":"#fefefe"},{"lightness":17},{"weight":1.2}]}],
scrollwheel: false,
navigationControl: true,
mapTypeControl: false,
scaleControl: true,
draggable: true
});

Download Pgeon Logo:


https://easyparcel.my/files/pgeon.png

Page 50

You might also like