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

# Get Insurance Rate

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

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.

## Endpoint

- Method: `POST`
- Demo URL: `https://demo.connect.easyparcel.my/?ac=EPInsuranceRateChecking`
- Live URL: `https://connect.easyparcel.my/?ac=EPInsuranceRateChecking`
- Body: `application/x-www-form-urlencoded`. Nested fields use PHP `http_build_query` names, e.g. `bulk[0][pick_code]`.
- 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_content_value` | double(8,2) | Yes | Parcel pricing |
| `courier` | string(25) | Yes | Shipment courier. (Refer to [Appendix IV](https://developers.easyparcel.com/my/marketplace/appendix/insurance-courier-list.md)) |
| `coll_country` | string(5) | Yes | Sender's country. (Refer to [Appendix II](https://developers.easyparcel.com/my/marketplace/appendix/country-code-list.md)) |
| `deli_country` | string(5) | Yes | Receiver's country. (Refer to [Appendix II](https://developers.easyparcel.com/my/marketplace/appendix/country-code-list.md)) |
| `coll_state` | string(25) | Yes | Sender's state. (Refer to [Appendix III](https://developers.easyparcel.com/my/marketplace/appendix/state-code-list.md)) |
| `deli_state` | string(25) | No | Receiver’s state, if deli_courtery is MY , will be required |

## Sample code

### PHP

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

### cURL

```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](#response-l2)) |
| `error_code` | int(5) | Error Code | (Refer to [Appendix I](https://developers.easyparcel.com/my/marketplace/appendix/api-return-status.md)) |
| `error_remark` | string(100) | Error Message | (Refer to [Appendix I](https://developers.easyparcel.com/my/marketplace/appendix/api-return-status.md)) |
| `error_detail` | object | Error Details |  |
| `status` | string(10) | Get rate status is Success / Fail |  |
| `api_status` | string(10) | API Validation result | (Refer to [Appendix I](https://developers.easyparcel.com/my/marketplace/appendix/api-return-status.md)) |

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

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `awb` | string(25) | The Air Waybill (AWB) number. |  |
| `courier` | string(100) | The name of the courier. |  |
| `parcel_content_value` | double(8,2) | The declared value of the parcel content. |  |
| `insurance_amount` | double(8,2) | The quoted amount for insurance coverage. |  |
| `parcel_delivery_type` | string(100) | Type of parcel delivery | domestic / international. |

## Response samples

### Success

```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"
}
```

### Fail

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

## Referenced appendices

Copied from the appendix pages linked above.

### Appendix IV: Insurance Courier List

Source: https://developers.easyparcel.com/my/marketplace/appendix/insurance-courier-list.md

| Courier | Courier Name |
| --- | --- |
| EP-CR0H | KEX Express |
| EP-CR01 | UTS |
| EP-CR03 | Aramex |
| EP-CR05 | Skynet |
| EP-CR0C | DHLeC |
| EP-CR0DS | Flash Express |
| EP-CR0A | Pos Laju |
| EP-CR0DP | J&T Express |
| EP-CR0DK | Pickupp |
| EP-CR0DU | Ninjavan |
| EP-CR0D3 | J&T Cargo |
| EP-CR0U | TNT |
| EP-CR0DH | Best Express |
| EP-CR0D1 | City-Link Express |
| EP-CR0T | FedEx |
| EP-CR06 | Aramex International |

### Appendix II: Country Code List

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

| Short Country Name | Full Country Name |
| --- | --- |
| SR | SURINAME |
| SD | SUDAN |
| VC | ST. VINCENT |
| XM | ST. MAARTEN |
| LC | ST. LUCIA |
| KN | ST. KITTS |
| XE | ST. EUSTATIUS |
| BL | ST. BARTHELEMY |
| LK | SRI LANKA |
| ES | SPAIN |
| ZA | SOUTH AFRICA |
| XS | SOMALILAND (NORTH SOMALIA) |
| SO | SOMALIA |
| SB | SOLOMON ISLANDS |
| SI | SLOVENIA |
| SK | SLOVAKIA |
| SG | SINGAPORE |
| SL | SIERRA LEONE |
| SC | SEYCHELLES |
| RS | SERBIA |
| SN | SENEGAL |
| SA | SAUDI ARABIA |
| ST | SAO TOME AND PRINCIPE |
| SM | SAN MARINO |
| WS | SAMOA |
| MP | SAIPAN |
| RW | RWANDA |
| RU | RUSSIAN FEDERATION |
| RO | ROMANIA |
| RE | REUNION |
| QA | QATAR |
| PR | PUERTO RICO |
| PT | PORTUGAL |
| PL | POLAND |
| PH | PHILIPPINES |
| PE | PERU |
| PY | PARAGUAY |
| PG | PAPUA NEW GUINEA |
| PA | PANAMA |
| PW | PALAU |
| PK | PAKISTAN |
| OM | OMAN |
| NO | NORWAY |
| NU | NIUE |
| NG | NIGERIA |
| NE | NIGER |
| NI | NICARAGUA |
| NZ | NEW ZEALAND |
| NC | NEW CALEDONIA |
| XN | NEVIS |
| NL | NETHERLANDS |
| NP | NEPAL |
| NR | NAURU |
| NA | NAMIBIA |
| MM | MYANMAR |
| MA | MOROCCO |
| MS | MONTSERRAT |
| ME | MONTENEGRO |
| MN | MONGOLIA |
| MC | MONACO |
| MD | MOLDOVA, REPUBLIC OF |
| FM | MICRONESIA, FEDERATED STATES OF |
| MX | MEXICO |
| YT | MAYOTTE |
| MU | MAURITIUS |
| MR | MAURITANIA |
| MQ | MARTINIQUE |
| MH | MARSHALL ISLANDS |
| MT | MALTA |
| ML | MALI |
| MV | MALDIVES |
| MW | MALAWI |
| MY | MALAYSIA |
| MG | MADAGASCAR |
| MK | MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF |
| MO | MACAU |
| LU | LUXEMBOURG |
| LT | LITHUANIA |
| LI | LIECHTENSTEIN |
| LY | LIBYA |
| LR | LIBERIA |
| LS | LESOTHO |
| LB | LEBANON |
| LV | LATVIA |
| LA | LAO PEOPLE'S DEMOCRATIC REPUBLIC |
| KG | KYRGYZSTAN |
| KW | KUWAIT |
| XK | KOSOVO |
| KR | KOREA, REPUBLIC OF |
| KP | KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF |
| KI | KIRIBATI |
| KE | KENYA |
| KZ | KAZAKHSTAN |
| JO | JORDAN |
| JE | JERSEY |
| JP | JAPAN |
| JM | JAMAICA |
| IT | ITALY |
| IL | ISRAEL |
| IE | IRELAND |
| IQ | IRAQ |
| IR | IRAN, ISLAMIC REPUBLIC OF |
| ID | INDONESIA |
| IN | INDIA |
| IS | ICELAND |
| HU | HUNGARY |
| HK | HONG KONG |
| HN | HONDURAS |
| HT | HAITI |
| GY | GUYANA |
| GW | GUINEA BISSAU |
| GN | GUINEA REPUBLIC |
| GG | GUERNSEY |
| GT | GUATEMALA |
| GU | GUAM |
| GP | GUADELOUPE |
| GD | GRENADA |
| GL | GREENLAND |
| GR | GREECE |
| GI | GIBRALTAR |
| GH | GHANA |
| DE | GERMANY |
| GE | GEORGIA |
| GM | GAMBIA |
| GA | GABON |
| ZW | ZIMBABWE |
| FR | FRANCE |
| FI | FINLAND |
| ZM | ZAMBIA |
| FJ | FIJI |
| YE | YEMEN |
| FO | FAROE ISLANDS |
| FK | FALKLAND ISLANDS (MALVINAS) |
| ET | ETHIOPIA |
| VI | VIRGIN ISLANDS, U.S. |
| EE | ESTONIA |
| VG | VIRGIN ISLANDS, BRITISH |
| ER | ERITREA |
| GQ | EQUATORIAL GUINEA |
| SV | EL SALVADOR |
| EG | EGYPT |
| VN | VIETNAM |
| EC | ECUADOR |
| TP | EAST TIMOR |
| VE | VENEZUELA |
| DO | DOMINICAN REPUBLIC |
| DM | DOMINICA |
| DJ | DJIBOUTI |
| VU | VANUATU |
| DK | DENMARK |
| CZ | CZECH REPUBLIC |
| CY | CYPRUS |
| CU | CUBA |
| UZ | UZBEKISTAN |
| UY | URUGUAY |
| HR | CROATIA |
| CI | COTE D'IVOIRE |
| CR | COSTA RICA |
| CK | COOK ISLANDS |
| CD | CONGO, THE DEMOCRATIC REPUBLIC OF THE |
| UM | UNITED STATES MINOR OUTLYING ISLANDS |
| CG | CONGO |
| KM | COMOROS |
| CN | CHINA |
| US | UNITED STATES |
| GF | FRENCH GUIANA |
| AN | NETHERLANDS ANTILLES |
| MZ | MOZAMBIQUE |
| CW | CURACAO |
| CO | COLOMBIA |
| CL | CHILE |
| TD | CHAD |
| CF | CENTRAL AFRICAN REPUBLIC |
| KY | CAYMAN ISLANDS |
| GB | UNITED KINGDOM |
| CV | CAPE VERDE |
| AE | UNITED ARAB EMIRATES |
| IC | CANARY ISLANDS, THE |
| CA | CANADA |
| UA | UKRAINE |
| CM | CAMEROON |
| KH | CAMBODIA |
| UG | UGANDA |
| BI | BURUNDI |
| BF | BURKINA FASO |
| BG | BULGARIA |
| BN | BRUNEI DARUSSALAM |
| TV | TUVALU |
| BR | BRAZIL |
| TC | TURKS AND CAICOS ISLANDS |
| TM | TURKMENISTAN |
| BW | BOTSWANA |
| BA | BOSNIA AND HERZEGOVINA |
| BQ | BONAIRE |
| BO | BOLIVIA |
| BT | BHUTAN |
| TR | TURKEY |
| BM | BERMUDA |
| TN | TUNISIA |
| BJ | BENIN |
| TT | TRINIDAD AND TOBAGO |
| BZ | BELIZE |
| TO | TONGA |
| BE | BELGIUM |
| TG | TOGO |
| BY | BELARUS |
| BB | BARBADOS |
| BD | BANGLADESH |
| BH | BAHRAIN |
| TH | THAILAND |
| BS | BAHAMAS |
| TZ | TANZANIA |
| AZ | AZERBAIJAN |
| TJ | TAJIKISTAN |
| AT | AUSTRIA |
| AU | AUSTRALIA |
| TW | TAIWAN |
| PF | TAHITI |
| AW | ARUBA |
| AM | ARMENIA |
| SY | SYRIA |
| AR | ARGENTINA |
| AG | ANTIGUA |
| AI | ANGUILLA |
| CH | SWITZERLAND |
| AO | ANGOLA |
| AD | ANDORRA |
| SE | SWEDEN |
| AS | AMERICAN SAMOA |
| SZ | SWAZILAND |
| DZ | ALGERIA |
| AL | ALBANIA |
| AF | AFGHANISTAN |

### 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).
