Get Insurance Rate
This enables users to check the insurance rates from specific courier companies on the EasyParcel platform. Users are required to fill in the necessary fields to access the insurance rate information.
POST
https://demo.connect.easyparcel.my/?ac=EPInsuranceRateChecking Body: application/x-www-form-urlencoded · action EPInsuranceRateChecking
Request parameters
Request L1
| Parameter | Type | Required | Description |
|---|---|---|---|
api | string(25) | Yes | Obtain from a registered account. |
awb | string(100) | Yes | Tracking number of the parcel |
parcel_ | double(8,2) | Yes | Parcel pricing |
courier | string(25) | Yes | Shipment courier. (Refer to Appendix IV) |
coll_ | string(5) | Yes | Sender's country. (Refer to Appendix II) |
deli_ | string(5) | Yes | Receiver's country. (Refer to Appendix II) |
coll_ | string(25) | Yes | Sender's state. (Refer to Appendix III) |
deli_ | string(25) | No | Receiver’s state, if deli_courtery is MY , will be required |
Sample code
php
<?php
$domain = "http://demo.connect.easyparcel.my/?ac=";
$action = "EPInsuranceRateChecking";
$postparam = array(
'api' => 'xxxxxx',
'awb' => 'TestingAWB',
'parcel_content_value' => '390',
'courier' => 'EP-CR05',
'coll_country' => 'MY',
'deli_country' => 'MY',
'coll_state' => 'srw',
'deli_state' => 'srw',
);
$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 'http://demo.connect.easyparcel.my/?ac=EPInsuranceRateChecking' \
--data-urlencode 'api=xxxxxx' \
--data-urlencode 'awb=TestingAWB' \
--data-urlencode 'parcel_content_value=390' \
--data-urlencode 'courier=EP-CR05' \
--data-urlencode 'coll_country=MY' \
--data-urlencode 'deli_country=MY' \
--data-urlencode 'coll_state=srw' \
--data-urlencode 'deli_state=srw'Response
Response L1
| Field | Type | Description | Remarks |
|---|---|---|---|
result | object | Result for rate checking | (Refer to Response L2) |
error_ | int(5) | Error Code | (Refer to Appendix I) |
error_ | string(100) | Error Message | (Refer to Appendix I) |
error_ | object | Error Details | |
status | string(10) | Get rate status is Success / Fail | |
api_ | string(10) | API Validation result | (Refer to Appendix I) |
Response L2 · result
| Field | Type | Description | Remarks |
|---|---|---|---|
awb | string(25) | The Air Waybill (AWB) number. | |
courier | string(100) | The name of the courier. | |
parcel_ | double(8,2) | The declared value of the parcel content. | |
insurance_ | double(8,2) | The quoted amount for insurance coverage. | |
parcel_ | string(100) | Type of parcel delivery | domestic / international. |
Response samples
json
{
"result": {
"awb": "TestingAWB",
"courier": "Skynet",
"parcel_content_value": "390",
"insurance_amount": 9.75,
"parcel_delivery_type": "Domestic"
},
"status": "Success",
"error_code": 0,
"error_remark": "",
"error_detail": "",
"api_status": "Success"
}json
{
"result":[
],
"status":"",
"error_code":"3",
"error_remark":"Required api key",
"api_status":"Error"
}