Market Rate Checking
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.
POST
https://demo.connect.easyparcel.my/?ac=MPNormalRateCheckingBulk Body: application/x-www-form-urlencoded · action MPNormalRateCheckingBulk
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 · bulk[]
| Parameter | Type | Required | Description |
|---|---|---|---|
pick_ | string(10) | Yes | Sender's postcode. |
pick_ | string(10) | Yes | Sender’s state |
pick_ | string(2) | Yes | Sender's country (“MY”). |
send_ | string(10) | Yes | Receiver's postcode. |
send_ | string(10) | Yes | Receiver’s state |
send_ | 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_ | date | Optional | Check the available pickup date. If the date is left empty, the default will be today’s date. Format : “YYYY-MM-DD” |
Sample code
php
<?php
$domain = "https://demo.connect.easyparcel.my/?ac=";
$action = "MPNormalRateCheckingBulk";
$postparam = array(
'authentication' => 'xxxxxx',
'api' => 'xxxxxx',
'bulk' => array(
array(
'pick_code' => '14300',
'pick_state' => 'nt',
'pick_country' => 'MY',
'send_code' => '81100',
'send_state' => 'jhr',
'send_country' => 'MY',
'weight' => '10',
'width' => '0',
'length' => '0',
'height' => '0',
'date_coll' => '2017-11-10',
),
array(
'pick_code' => '14300',
'pick_state' => 'nt',
'pick_country' => 'MY',
'send_code' => '81100',
'send_state' => 'jhr',
'send_country' => 'MY',
'weight' => '10',
'width' => '0',
'length' => '0',
'height' => '0',
'date_coll' => '2017-11-10',
),
),
);
$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>";
?>bash
curl -X POST 'https://demo.connect.easyparcel.my/?ac=MPNormalRateCheckingBulk' \
--data-urlencode 'authentication=xxxxxx' \
--data-urlencode 'api=xxxxxx' \
--data-urlencode 'bulk[0][pick_code]=14300' \
--data-urlencode 'bulk[0][pick_state]=nt' \
--data-urlencode 'bulk[0][pick_country]=MY' \
--data-urlencode 'bulk[0][send_code]=81100' \
--data-urlencode 'bulk[0][send_state]=jhr' \
--data-urlencode 'bulk[0][send_country]=MY' \
--data-urlencode 'bulk[0][weight]=10' \
--data-urlencode 'bulk[0][width]=0' \
--data-urlencode 'bulk[0][length]=0' \
--data-urlencode 'bulk[0][height]=0' \
--data-urlencode 'bulk[0][date_coll]=2017-11-10' \
--data-urlencode 'bulk[1][pick_code]=14300' \
--data-urlencode 'bulk[1][pick_state]=nt' \
--data-urlencode 'bulk[1][pick_country]=MY' \
--data-urlencode 'bulk[1][send_code]=81100' \
--data-urlencode 'bulk[1][send_state]=jhr' \
--data-urlencode 'bulk[1][send_country]=MY' \
--data-urlencode 'bulk[1][weight]=10' \
--data-urlencode 'bulk[1][width]=0' \
--data-urlencode 'bulk[1][length]=0' \
--data-urlencode 'bulk[1][height]=0' \
--data-urlencode 'bulk[1][date_coll]=2017-11-10'Response
Response L1
| Field | Type | Description | Remarks |
|---|---|---|---|
api_ | string(10) | Validation result | (Refer to Appendix I) |
error_ | int(5) | Error code | (Refer to Appendix I) |
error_ | string(100) | Error message | (Refer to Appendix I) |
result | array | Result of rate checking | (Refer to Response L2) |
Response L2 · result
| Field | Type | Description | Remarks |
|---|---|---|---|
status | string(10) | The status of the rate checking. | Fail / Success |
remarks | string(100) | The error message for rate checking. | |
rates | array | The response of the rate checking | (Refer to Response L3) |
Response L3 · rates
| Field | Type | Description | Remarks |
|---|---|---|---|
member_ | array | The result member rate checking. | (Refer to Response L4) |
non_ | array | The result non-member rate checking. | (Refer to Response L4) |
Response L4 · member_rate / non_member_rate
| Field | Type | Description | Remarks |
|---|---|---|---|
service_ | string (15) | Service ID | |
service_ | string (100) | Service name | |
service_ | string (10) | Type of service | parcel/ document |
courier_ | string (10) | Courier ID | |
courier_ | string (100) | Courier name | |
courier_ | string (300) | Courier logo | |
scheduled_ | string (50) | Scheduled pickup for parcel. | |
pickup_ | 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. |
Response samples
json
{
"api_status":"Success",
"error_code":"0",
"error_remark":"",
"result":[
{
"status":"Success",
"remarks":"",
"rates":{
"member_rate":[
{
"service_id":"EP-CS0W",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR05",
"courier_name":"Skynet",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Skynet_Express_(M)_Sdn_Bhd.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"19.90"
},
{
"service_id":"EP-CS04",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR0M",
"courier_name":"Nationwide",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Nationwide_Express_Courier_Services_Berhad.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"20.70"
},
{
"service_id":"EP-CS0A2",
"service_name":"Same Day Poslaju Pick up (within PM)",
"service_type":"parcel",
"courier_id":"EP-CR0A",
"courier_name":"Poslaju",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/POSLAJU_NATIONAL_COURIER.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"64.00"
}
],
"non_member_rate":[
{
"service_id":"EP-CS0W",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR05",
"courier_name":"Skynet",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Skynet_Express_(M)_Sdn_Bhd.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"36.00"
},
{
"service_id":"EP-CS04",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR0M",
"courier_name":"Nationwide",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Nationwide_Express_Courier_Services_Berhad.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"37.20"
},
{
"service_id":"EP-CS0A2",
"service_name":"Same Day Poslaju Pick up (within PM)",
"service_type":"parcel",
"courier_id":"EP-CR0A",
"courier_name":"Poslaju",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/POSLAJU_NATIONAL_COURIER.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"83.20"
}
]
}
},
{
"status":"Success",
"remarks":"",
"rates":{
"member_rate":[
{
"service_id":"EP-CS0W",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR05",
"courier_name":"Skynet",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Skynet_Express_(M)_Sdn_Bhd.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"19.90"
},
{
"service_id":"EP-CS04",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR0M",
"courier_name":"Nationwide",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Nationwide_Express_Courier_Services_Berhad.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"20.70"
},
{
"service_id":"EP-CS0A2",
"service_name":"Same Day Poslaju Pick up (within PM)",
"service_type":"parcel",
"courier_id":"EP-CR0A",
"courier_name":"Poslaju",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/POSLAJU_NATIONAL_COURIER.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"64.00"
}
],
"non_member_rate":[
{
"service_id":"EP-CS0W",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR05",
"courier_name":"Skynet",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Skynet_Express_(M)_Sdn_Bhd.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"36.00"
},
{
"service_id":"EP-CS04",
"service_name":"Next Day Delivery Service",
"service_type":"parcel",
"courier_id":"EP-CR0M",
"courier_name":"Nationwide",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/Nationwide_Express_Courier_Services_Berhad.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"37.20"
},
{
"service_id":"EP-CS0A2",
"service_name":"Same Day Poslaju Pick up (within PM)",
"service_type":"parcel",
"courier_id":"EP-CR0A",
"courier_name":"Poslaju",
"courier_logo":"http:\/\/cp.easyparcel.my\/v1\/include\/theme_1\/source\/img\/logo\/\/images\/partners\/POSLAJU_NATIONAL_COURIER.png",
"scheduled_start_date":"2017-11-10 Friday",
"pickup_date":"2017-11-10",
"delivery":"Estimated 1 working day(s)",
"price":"83.20"
}
]
}
}
]
}json
{
"api_status":"Error",
"error_code":"1",
"error_remark":"Required authentication key",
"result":[
]
}