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

# Making Order

> EasyParcel API · Malaysia · Individual · version 1.4.0.0
> Page: https://developers.easyparcel.com/my/individual/making-order · Markdown: https://developers.easyparcel.com/my/individual/making-order.md · PDF: https://developers.easyparcel.com/pdf/Malaysia_Individual_1.4.0.0.pdf

The authenticated user can make single order at EasyParcel. User need to make sure the courier service is available.

## Endpoint

- Method: `POST`
- Demo URL: `http://demo.connect.easyparcel.my/?ac=EPSubmitOrderBulk`
- Live URL: `https://connect.easyparcel.my/?ac=EPSubmitOrderBulk`
- Body: `application/x-www-form-urlencoded`. Nested fields use PHP `http_build_query` names, e.g. `bulk[0][pick_code]`.
- Action: `EPSubmitOrderBulk`

## Request parameters

### Request L1

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `api` | string(25) | Yes | Obtain from registered account. |
| `bulk` | array | Yes | (Refer to [Request L2](#request-l2)) |
| `idempotency_key` | string(255) | No | refer to https://easyparcel.github.io/nextgen-integration-doc/NextGenSwitches/idempotency_key |

### Request L2 · `bulk[]` {#request-l2}

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `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. |
| `content` | string(35) | Yes | The content of the parcel. |
| `value` | double(8,2) | Yes | The amount of the items. |
| `service_id` | string(10) | Yes | Obtain from EPRateChecking return value. |
| `pick_point` | string(35) | Yes / Optional | Obtain from EPRateChecking return value (point_id) from Dropoff_Point. |
| `pick_name` | string(35) | Yes | Sender's name. |
| `pick_company` | string(35) | Optional | Sender's company. |
| `pick_contact` | string(16) | Yes | Sender's contact. |
| `pick_mobile` | string(16) | Optional | Sender's mobile. |
| `pick_addr1` | string(35) | Yes | Sender's address line 1. |
| `pick_addr2` | string(35) | Optional | Sender's address line 2. |
| `pick_addr3` | string(35) | Optional | Sender's address line 3. |
| `pick_addr4` | string(35) | Optional | Sender's address line 4. |
| `pick_city` | string(35) | Yes | Sender's city. |
| `pick_state` | string(35) | Yes | Sender’s state. |
| `pick_code` | string(10) | Yes | Sender's postcode. |
| `pick_country` | string(35) | Yes | Sender's country.  (Refer to [Appendix II](https://developers.easyparcel.com/my/individual/appendix/country-code-list.md)) |
| `send_name` | string(35) | Yes | Receiver's name. |
| `send_company` | string(35) | Optional | Receiver's company. |
| `send_contact` | string(16) | Yes | Receiver's contact. |
| `send_mobile` | string(16) | Optional | Receiver's mobile. |
| `send_addr1` | string(35) | Yes | Receiver's address line 1. |
| `send_addr2` | string(35) | Optional | Receiver's address line 2. |
| `send_addr3` | string(35) | Optional | Receiver's address line 3. |
| `send_addr4` | string(35) | Optional | Receiver's address line 4. |
| `send_city` | string(35) | Yes | Receiver's city. |
| `send_state` | string(35) | Yes | Receiver’s state. |
| `send_code` |  | Yes | Receiver's postcode. |
| `send_country` | string(35) | Yes | Receiver's country.  (Refer to [Appendix II](https://developers.easyparcel.com/my/individual/appendix/country-code-list.md)) |
| `collect_date` | date | Yes | Check the available pickup date. If didn't put the date,today date will be default. Format : “YYYY-MM-DD” |
| `sms` | boolean | Yes | Require for sms feature (Example, true/false) |
| `send_email` | string(35) | Yes | Receiver’s email. |
| `hs_code` | string(20) | Optional | Hs code is a common standard worldwide for describing the type of commodity that is shipped |
| `REQ_ID` | string(100) | Optional | The reference for easier track back from Response (Refer to [Response L2](#response-l2)) |
| `reference` | string(25) | Optional | The parcel reference |
| `cod_enabled` | boolean | Optional | The parcel is COD parcel.  (true / false) \*Only Applicable for Courier Services which support COD, Refer to Rate Checking. |
| `cod_amount` | double(8,2) | Optional | The COD amount to be collected. Please refer to RateChecking for the minimum and maximum amount. |
| `tax_duty` | string(10) | Optional | DDU or DDP |
| `parcel_category_id` | string(10) | Optional | The parcel category id (Refer to Get Parcel Category) |
| `addon_insurance_enabled` | boolean | Optional | The parcel is to whether purchase additional insurance. To purchase additional insurance the parcel value must be above basic insurance coverage (Refer to RateChecking Result for the value. To purchase additional insurance, parcel category ID is a must. |
| `addon_whatsapp_tracking_enabled` | boolean | Optional | The parcel is to whether purchase WhatsApp tracking. The receiver phone must be valid for the WhatsApp tracking to be received |
| `eori_acknowledged` | boolean | Optional | For EasyParcel Business accounts, shipments to Europe require a valid EORI number to be configured in the Business Profile. Set this to true to acknowledge the risk and proceed with order submission without an EORI number provided |

## Sample code

### PHP

```php
<?php
$domain = "https://demo.connect.easyparcel.my/?ac=";

$action = "EPSubmitOrderBulk";
$postparam = array(
    'api' => 'xxxxxx',
    'bulk' => array(array(
            'weight' => '1',
            'width' => '1',
            'length' => '1',
            'height' => '1',
            'content' => 'book',
            'value' => '10',
            'service_id' => 'EP-CS0W',
            'pick_point' => '',
            'pick_name' => 'Yong Tat',
            'pick_company' => 'Yong Tat Sdn Bhd',
            'pick_contact' => '0123456789',
            'pick_mobile' => '0123456789',
            'pick_addr1' => 'ppppp46/7 adfa',
            'pick_addr2' => 'test',
            'pick_addr3' => '',
            'pick_addr4' => '',
            'pick_city' => 'city',
            'pick_state' => 'png',
            'pick_code' => '11950',
            'pick_country' => 'MY',
            'send_name' => 'sam',
            'send_company' => '',
            'send_contact' => '0122134567',
            'send_mobile' => '0122134567',
            'send_addr1' => 'ssssadsasdst test',
            'send_addr2' => 'test test',
            'send_addr3' => '',
            'send_addr4' => '',
            'send_city' => 'send city',
            'send_state' => 'png','send_code' => '11950',
            'send_country' => 'MY',
            'collect_date' => '2020-02-20',
            'sms' => '0',
            'send_email' => 'xxxxxx@hotmail.com',
            'hs_code' => 'yshs_code',
            'REQ_ID' => 'shipping # 1',
            'reference' => 'order12321',
            'cod_enabled' => true,
            'cod_amount' => '10.00',)
        ,)
    ,);

$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 'https://demo.connect.easyparcel.my/?ac=EPSubmitOrderBulk' \
  --data-urlencode 'api=xxxxxx' \
  --data-urlencode 'bulk[0][weight]=1' \
  --data-urlencode 'bulk[0][width]=1' \
  --data-urlencode 'bulk[0][length]=1' \
  --data-urlencode 'bulk[0][height]=1' \
  --data-urlencode 'bulk[0][content]=book' \
  --data-urlencode 'bulk[0][value]=10' \
  --data-urlencode 'bulk[0][service_id]=EP-CS0W' \
  --data-urlencode 'bulk[0][pick_point]=' \
  --data-urlencode 'bulk[0][pick_name]=Yong Tat' \
  --data-urlencode 'bulk[0][pick_company]=Yong Tat Sdn Bhd' \
  --data-urlencode 'bulk[0][pick_contact]=0123456789' \
  --data-urlencode 'bulk[0][pick_mobile]=0123456789' \
  --data-urlencode 'bulk[0][pick_addr1]=ppppp46/7 adfa' \
  --data-urlencode 'bulk[0][pick_addr2]=test' \
  --data-urlencode 'bulk[0][pick_addr3]=' \
  --data-urlencode 'bulk[0][pick_addr4]=' \
  --data-urlencode 'bulk[0][pick_city]=city' \
  --data-urlencode 'bulk[0][pick_state]=png' \
  --data-urlencode 'bulk[0][pick_code]=11950' \
  --data-urlencode 'bulk[0][pick_country]=MY' \
  --data-urlencode 'bulk[0][send_name]=sam' \
  --data-urlencode 'bulk[0][send_company]=' \
  --data-urlencode 'bulk[0][send_contact]=0122134567' \
  --data-urlencode 'bulk[0][send_mobile]=0122134567' \
  --data-urlencode 'bulk[0][send_addr1]=ssssadsasdst test' \
  --data-urlencode 'bulk[0][send_addr2]=test test' \
  --data-urlencode 'bulk[0][send_addr3]=' \
  --data-urlencode 'bulk[0][send_addr4]=' \
  --data-urlencode 'bulk[0][send_city]=send city' \
  --data-urlencode 'bulk[0][send_state]=png' \
  --data-urlencode 'bulk[0][send_code]=11950' \
  --data-urlencode 'bulk[0][send_country]=MY' \
  --data-urlencode 'bulk[0][collect_date]=2020-02-20' \
  --data-urlencode 'bulk[0][sms]=0' \
  --data-urlencode 'bulk[0][send_email]=xxxxxx@hotmail.com' \
  --data-urlencode 'bulk[0][hs_code]=yshs_code' \
  --data-urlencode 'bulk[0][REQ_ID]=shipping # 1' \
  --data-urlencode 'bulk[0][reference]=order12321' \
  --data-urlencode 'bulk[0][cod_enabled]=1' \
  --data-urlencode 'bulk[0][cod_amount]=10.00'
```

## Response

### Response L1

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `result` | array | Result for making order | (Refer to [Response L2](#response-l2)) |
| `api_status` | string(10) | Validation result | (Refer to [Appendix I](https://developers.easyparcel.com/my/individual/appendix/api-return-status.md)) |
| `error_code` | int(5) | Error code | (Refer to [Appendix I](https://developers.easyparcel.com/my/individual/appendix/api-return-status.md)) |
| `error_remark` | string(100) | Error message | (Refer to [Appendix I](https://developers.easyparcel.com/my/individual/appendix/api-return-status.md)) |

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

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `REQ_ID` | string(100) | The reference pass back from Request |  |
| `parcel_number` | string(12) | The response of the parcel placed. |  |
| `order_number` | string(12) | The response of the order placed. |  |
| `price` | double(8,2) | Order total price inclusive of all charges |  |
| `status` | string(10) | The status of the orders made. | Fail / Success |
| `remarks` | string(100) | The error message for orders made. |  |
| `courier` | string(35) | The courier selected of the shipment |  |
| `cod_charges` | double(8,2) | The COD charges that will be charged for COD parcels. |  |
| `insurance_charges` | double(8,2) | The Addon Insurance Charges | The Addon Insurance Charges is calculated based and returned accordingly. |
| `max_insurance_coverage` | double(8,2) | The Amount Maximum Claimable Under Insurance | The maximum amount claimable under the shipment order made. Terms and Conditions Apply. |
| `shipment_price` | double(8,2) | The Shipment Charges Only |  |
| `addon_whatsapp_tracking_charges` | double(8,2) | The WhatsApp Tracking Charges Only |  |

## Response samples

### Success

```json
{
  "result":[
    {
      "REQ_ID":"shipping # 1",
      "parcel_number":"EP-PQKTE",
      "order_number":"EI-5UFAI",
      "price":"6.10",
      "status":"Success",
      "remarks":"Order Successfully Placed.",
      "courier":"Skynet"
    }
  ],
  "api_status":"Success",
  "error_code":"0",
  "error_remark":""
}
```

### Fail

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

## Referenced appendices

Copied from the appendix pages linked above.

### Appendix II: Country Code List

Source: https://developers.easyparcel.com/my/individual/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 I: API Return Status

Source: https://developers.easyparcel.com/my/individual/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).
