Easyparcel Marketplace Api Documentation V3.0.0
Easyparcel Marketplace Api Documentation V3.0.0
DOCUMENTATION v3.0.0
EasyParcel API Documentation v3.0.0
No Content Page
1 Overview 3
2 Base URL 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
11 Credit Checking 34 - 37
10.1 - URL
10.2 - HTTP post request
10.3 - Response / Return value
10.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
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
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
Page 4
EasyParcel API Documentation v3.0.0
5.1 URL
For Live : http://connect.easyparcel.my/?ac=MPRateChecking
For Demo : http://demo.connect.easyparcel.my/?ac=MPRateChecking
Page 5
EasyParcel API Documentation v3.0.0
Page 6
EasyParcel API Documentation v3.0.0
Page 7
EasyParcel API Documentation v3.0.0
$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
],
"api_status":"Error",
"error_code":"2",
"error_remark":"Invalid authentication key"
}
Page 9
EasyParcel API Documentation v3.0.0
Page 10
EasyParcel API Documentation v3.0.0
Page 11
EasyParcel API Documentation v3.0.0
6.1 URL
For Live : http://connect.easyparcel.my/?ac=MPSubmitOrder
For Demo : http://demo.connect.easyparcel.my/?ac=MPSubmitOrder
Page 12
EasyParcel API Documentation v3.0.0
Page 13
EasyParcel API Documentation v3.0.0
$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",
'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
Page 15
EasyParcel API Documentation v3.0.0
Page 16
EasyParcel API Documentation v3.0.0
7.1 URL
For Live : http://connect.easyparcel.my/?ac=MPPayOrder
For Demo : http://demo.connect.easyparcel.my/?ac=MPPayOrder
Page 17
EasyParcel API Documentation v3.0.0
Page 18
EasyParcel API Documentation v3.0.0
$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
],
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}
Page 20
EasyParcel API Documentation v3.0.0
Page 21
EasyParcel API Documentation v3.0.0
8.1 URL
For Live : http://connect.easyparcel.my/?ac=MPOrderStatus
For Demo : http://demo.connect.easyparcel.my/?ac=MPOrderStatus
Page 22
EasyParcel API Documentation v3.0.0
$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
],
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}
Page 24
EasyParcel API Documentation v3.0.0
Page 25
EasyParcel API Documentation v3.0.0
9.1 URL
For Live : http://connect.easyparcel.my/?ac=MPParcelStatus
For Demo : http://demo.connect.easyparcel.my/?ac=MPParcelStatus
Page 26
EasyParcel API Documentation v3.0.0
Page 27
EasyParcel API Documentation v3.0.0
$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
],
"status":"",
"remarks":"",
"order_no":"",
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}
Page 29
EasyParcel API Documentation v3.0.0
Page 30
EasyParcel API Documentation v3.0.0
10.1 URL
For Live : http://connect.easyparcel.my/?ac=MPTracking
For Demo : http://demo.connect.easyparcel.my/?ac=MPTracking
Page 31
EasyParcel API Documentation v3.0.0
$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
],
"latest_status":"",
"latest_update":"",
"awb":"",
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}
Page 33
EasyParcel API Documentation v3.0.0
Page 34
EasyParcel API Documentation v3.0.0
11.1 URL
For Live : http://connect.easyparcel.my/?ac=EPCheckCreditBalance
For Demo : http://demo.connect.easyparcel.my/?ac=EPCheckCreditBalance
Page 35
EasyParcel API Documentation v3.0.0
$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
Page 37
EasyParcel API Documentation v3.0.0
Page 38
EasyParcel API Documentation v3.0.0
12.1 URL
For Live : http://connect.easyparcel.my/?ac=MPNormalRateChecking
For Demo : http://demo.connect.easyparcel.my/?ac=MPNormalRateChecking
Page 39
EasyParcel API Documentation v3.0.0
Page 40
EasyParcel API Documentation v3.0.0
$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>";
?>
],
"api_status":"Error",
"error_code":"4",
"error_remark":"Invalid api key"
}
Page 41
EasyParcel API Documentation v3.0.0
Page 42
EasyParcel API Documentation v3.0.0
Page 43
EasyParcel API Documentation v3.0.0
13.1 URL
For Live : http://connect.easyparcel.my/?ac=MPUserSignUp
For Demo : http://demo.connect.easyparcel.my/?ac=MPUserSignUp
Page 44
EasyParcel API Documentation v3.0.0
$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
],
"api_status":"Error",
"error_code":"2",
"error_remark":"Invalid authentication key"
}
Page 46
EasyParcel API Documentation v3.0.0
APPENDIX
Page 47
EasyParcel API Documentation v3.0.0
Page 48
EasyParcel API Documentation v3.0.0
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
});
Page 50