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

# Get Insurance Rate

> EasyParcel API · Singapore · MarketPlace · version 1.1.1.0
> Page: https://developers.easyparcel.com/sg/marketplace/get-insurance-rate · Markdown: https://developers.easyparcel.com/sg/marketplace/get-insurance-rate.md · PDF: https://developers.easyparcel.com/pdf/Singapore_MarketPlace_1.1.1.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.sg/?ac=EPInsuranceRateChecking`
- Live URL: `https://connect.easyparcel.sg/?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/sg/marketplace/appendix/insurance-courier-list.md)) |
| `coll_country` | string(5) | Yes | Sender's country. (Refer to [Appendix II](https://developers.easyparcel.com/sg/marketplace/appendix/country-code-list.md)) |
| `deli_country` | string(5) | Yes | Receiver's country. (Refer to [Appendix II](https://developers.easyparcel.com/sg/marketplace/appendix/country-code-list.md)) |
| `coll_state` | string(25) | Yes | Sender's state. (Refer to Appendix III) |
| `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.sg/?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.sg/?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/sg/marketplace/appendix/api-return-status.md)) |
| `error_remark` | string(100) | Error Message | (Refer to [Appendix I](https://developers.easyparcel.com/sg/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/sg/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/sg/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/sg/marketplace/appendix/country-code-list.md

| Short Country Name | Full Country Name |
| --- | --- |
| SG | SINGAPORE |
| AU | AUSTRALIA |
| BN | BRUNEI DARUSSALAM |
| KH | CAMBODIA |
| CA | CANADA |
| CN | CHINA |
| HK | HONG KONG |
| JP | JAPAN |
| MO | MACAU |
| MM | MYANMAR |
| MY | MALAYSIA |
| NZ | NEW ZEALAND |
| KR | KOREA, REPUBLIC OF |
| TW | TAIWAN |
| TH | THAILAND |
| GB | UNITED KINGDOM |
| US | UNITED STATES |
| VN | VIETNAM |

### Appendix I: API Return Status

Source: https://developers.easyparcel.com/sg/marketplace/appendix/api-return-status.md

| api_status | error_code | error_remark |
| --- | --- | --- |
| Error | 3 | Required api key |
| Error | 4 | Invalid api key |
| Error | 5 | Unauthorized user |
| Success | 0 |  |

Support: WhatsApp EasyParcel API Support — https://api.whatsapp.com/send/?phone=6042023160

Published by EasyParcel Singapore Pte Ltd (201605202W). GST No: 201605202W.
