Domestic Express Order
This endpoint is designed to direct create order + payment at EasyParcel. Currently it is limited within Domestic (Malaysia) shipping delivery.
POST
https://demo.connect.easyparcel.my/?ac=EPSubmitOrderBulkV3 Body: application/x-www-form-urlencoded · action EPSubmitOrderBulkV3
Request parameters
Request L1
| Parameter | Type | Required | Description |
|---|---|---|---|
authentication | string(25) | Yes | Obtain from EasyParcel IT administrator |
api | string(25) | Yes | Obtain from registered account. |
courier | array | Yes | Courier List : 'Poslaju', 'Skynet', 'Nationwide', 'ABX', 'DHL eCommerce', 'Aramex', 'CJ Century', 'UTS', 'ULTIMATE CONSOLIDATORS' If the first courier is not available, it will select the next available courier in the array |
dropoff | int(1) | Optional | Require for dropoff service. Value: 0,1 (e.g, 1 = true/ 0 =false[Default ]) |
bulk | array | Yes | (Refer to Request L2) |
Request L2 · bulk[]
| Parameter | Type | Required | Description |
|---|---|---|---|
referrence | string | Yes | Require identifier of vendor’s order |
weight | double(8,2) | Yes | The weight of the parcel. |
content | string(35) | Yes | The content of the parcel. |
value | double(8,2) | Yes | The amount of the items. |
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. (Refer to Appendix III) |
pick_ | string(10) | Yes | Sender's postcode. |
pick_ | string(35) | Yes | Sender's country. Refer to ISO 3166-2 |
send_ | string(35) | Yes | Receiver's name. |
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. (Refer to Appendix III) |
send_ | string(10) | Yes | Receiver's postcode. |
send_ | string(35) | Yes | Receiver's country. Refer to ISO 3166-2 |
collect_ | date | Yes | Check the available pickup date. If didn't put the date,today date will be default. Format : “YYYY-MM-DD” |
send_ | string | Yes | Receiver’s email. |
sms | boolean | Optional | Require for sms feature, Value: 0,1 (e.g, 1 = true/ 0 =false[Default]) |
Sample code
php
<?php
$domain = "https://demo.connect.easyparcel.my/?ac=";
$action = "EPSubmitOrderBulkV3";
$postparam = array(
'authentication'=> 'xxxxxx',
'api' => 'xxxxxx',
'courier' => array('Poslaju'),
'dropoff' => '0',
'bulk' => array(
array(
'referrence' => 'item1',
'weight' => '1',
'content' => '2017-09-14 - book',
'value' => '20',
'pick_name' => 'Yong Tat',
'pick_company' => 'Yong Tat Sdn Bhd',
'pick_contact' => '+6012-1234-5678',
'pick_mobile' => '+6017-1234-5678',
'pick_addr1' => 'ppppp46/7 adfa',
'pick_addr2' => 'test',
'pick_addr3' => 'test',
'pick_addr4' => '',
'pick_city' => 'png',
'pick_state' => 'png',
'pick_code' => '14300',
'pick_country' => 'MY',
'send_name' => 'Sam',
'send_contact' => '+6012-2134567',
'send_mobile' => '+6017-1234-5678',
'send_addr1' => 'ssssadsasdst test',
'send_addr2' => 'test test',
'send_addr3' => 'test',
'send_addr4' => '',
'send_city' => 'png',
'send_state' => 'png',
'send_code' => '11950',
'send_country' => 'MY',
'collect_date' => '2020-03-16',
'send_email' => '[email protected]',
'sms' => '0',
),
),
);
$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=EPSubmitOrderBulkV3' \
--data-urlencode 'authentication=xxxxxx' \
--data-urlencode 'api=xxxxxx' \
--data-urlencode 'courier[0]=Poslaju' \
--data-urlencode 'dropoff=0' \
--data-urlencode 'bulk[0][referrence]=item1' \
--data-urlencode 'bulk[0][weight]=1' \
--data-urlencode 'bulk[0][content]=2017-09-14 - book' \
--data-urlencode 'bulk[0][value]=20' \
--data-urlencode 'bulk[0][pick_name]=Yong Tat' \
--data-urlencode 'bulk[0][pick_company]=Yong Tat Sdn Bhd' \
--data-urlencode 'bulk[0][pick_contact]=+6012-1234-5678' \
--data-urlencode 'bulk[0][pick_mobile]=+6017-1234-5678' \
--data-urlencode 'bulk[0][pick_addr1]=ppppp46/7 adfa' \
--data-urlencode 'bulk[0][pick_addr2]=test' \
--data-urlencode 'bulk[0][pick_addr3]=test' \
--data-urlencode 'bulk[0][pick_addr4]=' \
--data-urlencode 'bulk[0][pick_city]=png' \
--data-urlencode 'bulk[0][pick_state]=png' \
--data-urlencode 'bulk[0][pick_code]=14300' \
--data-urlencode 'bulk[0][pick_country]=MY' \
--data-urlencode 'bulk[0][send_name]=Sam' \
--data-urlencode 'bulk[0][send_contact]=+6012-2134567' \
--data-urlencode 'bulk[0][send_mobile]=+6017-1234-5678' \
--data-urlencode 'bulk[0][send_addr1]=ssssadsasdst test' \
--data-urlencode 'bulk[0][send_addr2]=test test' \
--data-urlencode 'bulk[0][send_addr3]=test' \
--data-urlencode 'bulk[0][send_addr4]=' \
--data-urlencode 'bulk[0][send_city]=png' \
--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-03-16' \
--data-urlencode 'bulk[0][send_email][email protected]' \
--data-urlencode 'bulk[0][sms]=0'Response
Response L1
| Field | Type | Description | Remarks |
|---|---|---|---|
api_ | string | Validation result | (Refer to Appendix I) |
error_ | int | Error code | (Refer to Appendix I) |
error_ | string | Error message | (Refer to Appendix I) |
result | array | Result for make order | (Refer to Response L2) |
Response L2 · result
| Field | Type | Description | Remarks |
|---|---|---|---|
summary | object | Summary of Result | (Refer to Response L3) |
success | array | Success order | (Refer to Response L4) |
fail | array | Fail order with reason | (Refer to Response L5) |
Response L3 · summary
| Field | Type | Description | Remarks |
|---|---|---|---|
courier_ | array | The response of courier selected from order | |
orders_ | array | The response of the order number placed. | |
total_ | double(8,2) | Total of order price | |
total_ | int | Total of success order | |
total_ | int | Total of fail order |
Response L4 · success
| Field | Type | Description | Remarks |
|---|---|---|---|
referrence | string | The reference pass back from Request | |
status | string | The status of the orders made. | |
remarks | string | The error message for orders made. | |
order_ | string | The response of the order number placed. | |
courier | string | The response of the courier full name | |
courier_ | string | The response of the courier shot name | |
price | double(8,2) | shipping price of this parcel | shipping + tax + addon |
tax | double(8,2) | tax amount | |
addon_ | double(8,2) | add on price | Setting on easyparcel website - marketing tools |
parcel_ | string | The response of the parcel number placed. | |
awb | string | Airway bill number / Tracking Number | |
awb_ | string | PDF link of Airway bill number. | consignment note |
tracking_ | string | Link of tracking url. |
Response L5 · fail
| Field | Type | Description | Remarks |
|---|---|---|---|
referrence | string | The reference pass back from Request | |
status | string | The status of the orders made. | |
remarks | string | The error message for orders made. |
Response samples
json
{
"api_status":"Success",
"error_code":0,
"error_remark":"",
"result":{
"summary":{
"courier_service":[
"POSLAJU NATIONAL COURIER"
],
"orders_number":[
"EI-5UF8T"
],
"total_paid_amount":"8.15",
"total_success":1,
"total_fail":0
},
"success":[
{
"referrence":"item1",
"status":"Success",
"remarks":"Order Successfully Placed And Paid.",
"order_number":"EI-5UF8T",
"courier":"POSLAJU NATIONAL COURIER",
"courier_short":"Pos Laju",
"price":"8.00",
"tax":"0.00",
"addon_price":"0.15",
"parcel_number":"EP-PXUIB",
"awb":"ER665997516MY",
"awb_id_link":"http:\/\/demo.connect.easyparcel.my\/?ac=AWBLabel&id=b0VYQjhEMW4jMTc0OTc4MzA%3D",
"tracking_url":"https:\/\/easyparcel.com\/my\/en\/track\/details\/?courier=Poslaju&awb=ER665997516MY"
}
],
"fail":[
]
}
}json
{
"api_status":"Error",
"error_code":3,
"error_remark":"Required api key",
"result":{
"summary":[
],
"success":[
],
"fail":[
]
}
}