Making Order
The authenticated user can make single order at EasyParcel. User need to make sure the courier service is available.
POST
http://demo.connect.easyparcel.my/?ac=EPSubmitOrderBulk Body: application/x-www-form-urlencoded · 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) |
idempotency_ | string(255) | No | refer to https://easyparcel.github.io/nextgen-integration-doc/NextGenSwitches/idempotency_key |
Request L2 · bulk[]
| 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_ | string(10) | Yes | Obtain from EPRateChecking return value. |
pick_ | string(35) | Yes / Optional | Obtain from EPRateChecking return value (point_id) from Dropoff_Point. |
pick_ | string(35) | Yes | Sender's name. |
pick_ | string(35) | Optional | Sender's company. |
pick_ | string(16) | Yes | Sender's contact. |
pick_ | string(16) | Optional | Sender's mobile. |
pick_ | string(35) | Yes | Sender's address line 1. |
pick_ | string(35) | Optional | Sender's address line 2. |
pick_ | string(35) | Optional | Sender's address line 3. |
pick_ | string(35) | Optional | Sender's address line 4. |
pick_ | string(35) | Yes | Sender's city. |
pick_ | string(35) | Yes | Sender’s state. |
pick_ | string(10) | Yes | Sender's postcode. |
pick_ | string(35) | Yes | Sender's country. (Refer to Appendix II) |
send_ | string(35) | Yes | Receiver's name. |
send_ | string(35) | Optional | Receiver's company. |
send_ | string(16) | Yes | Receiver's contact. |
send_ | string(16) | Optional | Receiver's mobile. |
send_ | string(35) | Yes | Receiver's address line 1. |
send_ | string(35) | Optional | Receiver's address line 2. |
send_ | string(35) | Optional | Receiver's address line 3. |
send_ | string(35) | Optional | Receiver's address line 4. |
send_ | string(35) | Yes | Receiver's city. |
send_ | string(35) | Yes | Receiver’s state. |
send_ | Yes | Receiver's postcode. | |
send_ | string(35) | Yes | Receiver's country. (Refer to Appendix II) |
collect_ | 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_ | string(35) | Yes | Receiver’s email. |
hs_ | string(20) | Optional | Hs code is a common standard worldwide for describing the type of commodity that is shipped |
REQ_ | string(100) | Optional | The reference for easier track back from Response (Refer to Response L2) |
reference | string(25) | Optional | The parcel reference |
cod_ | boolean | Optional | The parcel is COD parcel. (true / false) *Only Applicable for Courier Services which support COD, Refer to Rate Checking. |
cod_ | double(8,2) | Optional | The COD amount to be collected. Please refer to RateChecking for the minimum and maximum amount. |
tax_ | string(10) | Optional | DDU or DDP |
parcel_ | string(10) | Optional | The parcel category id (Refer to Get Parcel Category) |
addon_ | 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_ | boolean | Optional | The parcel is to whether purchase WhatsApp tracking. The receiver phone must be valid for the WhatsApp tracking to be received |
eori_ | 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
$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' => '[email protected]',
'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>";
?>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][email protected]' \
--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) |
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) |
Response L2 · result
| Field | Type | Description | Remarks |
|---|---|---|---|
REQ_ | string(100) | The reference pass back from Request | |
parcel_ | string(12) | The response of the parcel placed. | |
order_ | 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_ | double(8,2) | The COD charges that will be charged for COD parcels. | |
insurance_ | double(8,2) | The Addon Insurance Charges | The Addon Insurance Charges is calculated based and returned accordingly. |
max_ | double(8,2) | The Amount Maximum Claimable Under Insurance | The maximum amount claimable under the shipment order made. Terms and Conditions Apply. |
shipment_ | double(8,2) | The Shipment Charges Only | |
addon_ | double(8,2) | The WhatsApp Tracking Charges Only |
Response samples
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":""
}json
{
"result":[
],
"api_status":"Error",
"error_code":"3",
"error_remark":"Required api key"
}