API Testing
API Testing
API Testing
0)
Revision
Date Author Activity Approver
2|Page
The API System Document
CONTENT
A. INTRODUCTION.................................................................................................................... 2
B. OVERVIEW ............................................................................................................................. 2
1. Workflow .............................................................................................................................................. 3
1|Page
The API System Document
A. INTRODUCTION
The SPEEDLINK API is the system that allows shops, suppliers and units used forwarding services that
can be connecting their system to SPEEDLINK System. SPEEDLINK provides effectively services.
B. OVERVIEW
1. Operating Process.
The partner sent transportation requesting from the Partner’s System to SPEEDLINK about:
Pickup Information, Shipping Information, Order Detail, …
When the order was processed, SPEEDLINK will announce the status of shipments to partners.
The steps will be completed when the orders have been updated status: Delivered, Canceled or
Refund, …
2|Page
The API System Document
C. API INTEGRATED
1. Workflow
2. Specialist words
API Key: are string of characters and integers which are encrypted follow to Speedlink structure
for identifying the Partners is connecting to Speedlink System. API Key will be provided by
Speedlink
API Secret Key: are string of characters and integers which are encrypted follow to Speedlink
structure. Used to encrypt Authorization the partner information sent to Speedlink system. API
Secret Key will be provided by Speedlink
Authorization: is the code which used to authenticate the information sent by the partner to the
Speedlink System allows information into the Speedlink System.
3|Page
The API System Document
3. API list
3.1. Formula for Creating Authorization
PHP
$Authorization = hash_hmac('sha1','SPEEDLINK', $parameters.$secret_key);
C#
Authorization = ShaHash('SPEEDLINK', Parameters + Secret_key);
return hash;
Production : http://partner.speedlink.vn/Partner/createOrder
Staging : http://staging.partner.speedlink.vn/Partner/createOrder
4|Page
The API System Document
Type: POST
Header
Body
Parameters
5|Page
The API System Document
6|Page
The API System Document
Parameters Example:
"api_key":"9589DB3159129AE6FBC6C850A39AABA0544A4B7C",
"timestamp":1539939852,
"data":{
"order_no":"124SP702313189",
"pickup_address_code":"VN034018004",
"shipper_phone":"01245678901",
"shipper_name":"Trung Qu\u00e2n",
"receiver_address_code":"VN034018005",
"receiver_name":"anh A",
"receiver_phone":"0123456789",
"weight":1200,
"service_code":"ES2",
"payment_method":2,
"payer":1,
"cod_value":0,
"cash":0,
7|Page
The API System Document
"dimensions":[
{"pcs":1,"height":130,"width":100,"length":100},
{"pcs":1,"height":100,"width":100,"length":100}
],
"shipment_value": 10000.500,
"insurance_value": 10000.500,
"drop_off": true,
"coupon_code": "SPL10K",
"coupon_value": 10000
Response Example:
"error_code": 1 ,
"booking_no":"001479/09102018/bk-qs",
"estimated_fee": 150000,
"estimated_time_from": 1,
"estimated_time_to": 2,
"coupon_code":"FREE",
"coupon_code_status": true,
"coupon_value": 1,
"remaining_use_times": 1,
8|Page
The API System Document
"remain": 0
9|Page
The API System Document
118 cod_value can not empty because the service used is supported
Type: POST
Header
Body
Parameters
10 | P a g e
The API System Document
VD: 1507884060
11 | P a g e
The API System Document
12 | P a g e
The API System Document
Parameters Example:
"api_key":"9589DB3159129AE6FBC6C850A39AABA0544A4B7C",
"timestamp":1539939852,
"data":{
"order_no":"124SP702313189",
"pickup_address_code":"",
"pickup_country_code": "VIETNAM",
"pickup_city_code": "1",
"pickup_district_code": "14",
"pickup_ward_code": "26941",
"shipper_phone":"01245678901",
"shipper_name":"Trung Qu\u00e2n",
"receiver_address_code": "",
"receiver_country_code": "VIETNAM",
"receiver_city_code": "1",
"receiver_district_code": "14",
"receiver_ward_code": "26941",
13 | P a g e
The API System Document
"receiver_name":"anh A",
"receiver_phone":"0123456789",
"weight":1200,
"service_code":"ES2",
"payment_method":2,
"payer":1,
"cod_value":0,
"cash":0,
"dimensions":[
{"pcs":1,"height":130,"width":100,"length":100},
{"pcs":1,"height":100,"width":100,"length":100}
],
"shipment_value": 10000.500,
"insurance_value": 10000.500,
"drop_off":true,
"coupon_code": "SPL10K",
"coupon_value": 10000
Response Example:
"error_code": 1 ,
14 | P a g e
The API System Document
"booking_no":"001479/09102018/bk-qs",
"estimated_fee": 150000,
"estimated_time_from": 1,
"estimated_time_to": 2,
"coupon_code":"FREE",
"coupon_code_status": true,
"coupon_value": 1,
"remaining_use_times": 1,
"remain": 0
15 | P a g e
The API System Document
118 cod_value can not empty because the service used is supported
Production : http://partner.speedlink.vn/Partner/editOrder
Staging : http://staging.partner.speedlink.vn/Partner/editOrder
Type: POST
Header
16 | P a g e
The API System Document
Authorization : Transmit to Verification Code which was created by the above formula
Body
Parameters
17 | P a g e
The API System Document
3 : Net off
18 | P a g e
The API System Document
Parameters Example:
"api_key":"9589DB3159129AE6FBC6C850A39AABA0544A4B7C",
"timestamp":1539940432,
"data":{
"order_no":"124SP702313189",
"pickup_address_code":"VN034018004",
"shipper_phone":"01245678901",
"shipper_name":"Trung Qu\u00e2n",
"receiver_address_code":"VN034018005",
"receiver_name":"anh A",
"receiver_phone":"0123456789",
"weight":1200,
"service_code":"ES2",
"payment_method":2,
"payer":1,
"cod_value":0,
"cash":0,
19 | P a g e
The API System Document
"dimensions":[
{"pcs":1,"height":130,"width":100,"length":100},
{"pcs":1,"height":100,"width":100,"length":100}
Result Example:
"error_code":1 ,
102 cod_value can not empty because the service used is supported
104 cod_value must be greater than 0 because the service used is supported
20 | P a g e
The API System Document
Production : http://partner.speedlink.vn/Partner/cancelOrder
Staging : http://staging.partner.speedlink.vn/Partner/cancelOrder
Type: POST
Header
Body
Parameters
21 | P a g e
The API System Document
"api_key":"9589DB3159129AE6FBC6C850A39AABA0544A4B7C",
"timestamp":1539940710,
"order_no":"124SP702313189"
Response Example:
"error_code":1 ,
22 | P a g e
The API System Document
Production : http://partner.speedlink.vn/Partner/trackingOrder
Staging : http://staging.partner.speedlink.vn/Partner/trackingOrder
Type: POST
Header
Body
Parameters
Parameters Example:
"api_key":"9589DB3159129AE6FBC6C850A39AABA0544A4B7C",
"timestamp":1539940852,
23 | P a g e
The API System Document
"order_no":"124SP70231321"
"error_code": 1,
"order": {
"detail": {
},
"tracking": [
},
],
"history": [
},
24 | P a g e
The API System Document
Production : http://partner.speedlink.vn/Partner/getStatusOrder
Staging : http://staging.partner.speedlink.vn/Partner/getStatusOrder
Type: POST
Header
Body
25 | P a g e
The API System Document
Parameters
Parameters Example:
"api_key":"9589DB3159129AE6FBC6C850A39AABA0544A4B7C",
"timestamp":1539941493,
"order_no":"124SP70231321"
Response Example:
"error_code":1 ,
“order”: {
"tracking_no":"124SP70231326",
"status" : “Processing”,
"reason_code" : 1300
26 | P a g e
The API System Document
Link API
Production : http://partner.speedlink.vn/Partner/checkTransportationFee
Staging : http://staging.api.speedlink.vn/Partner/checkTransportationFee
Type: POST
Header
Body
27 | P a g e
The API System Document
Parameters
Param Example:
"api_key":"E455A7DC358CB61CD49C5FA0EDD6FFBF67AB5166",
"timestamp":1540362936,
"data":{
"pickup_address_code":"VN039006006",
"receive_address_code":"VN039006006",
"service":"ES1",
"weight":2,
"is_ras":true,
28 | P a g e
The API System Document
"cod_value":20000
Result Example:
"error_code": 1 ,
"data":[
"price":20849,
"surcharge":"15%",
"cod_fee":20000,
"vat":4398,
"total":48374
29 | P a g e
The API System Document
Method: POST
Header
Content-Type : application/json
Authorization : Partner provide for speedlind IT
Body
"tracking_no_spl":"SPL0282371032",
30 | P a g e
The API System Document
"tracking_no": "0124742389",
"status": "Detained",
"reason_code": "3220",
"cash": 28900,
"weight": 6,
Parameters
31 | P a g e
The API System Document
"status":"200",
"message":"Update Success"
Status code
200 Success
!= 200 Fail
32 | P a g e