4. Order Status Retrieval API
This API is used to retrieve the current status of a GHTK order code.
Description
After the order has been sent to Giaohangtietkiem’s system, customers can check the order status using the order code.
Request
Hyperlink
GET /services/shipment/v2/{TRACKING_ORDER}
Headers
Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}
Parameters
| Parameter | Required | Description |
|---|---|---|
| TRACKING_ORDER | yes | The GHTK order code or the Partner's order code is passed through the order.id field in the order creation API |
Code
- HTTP
- CURL
- PHP
GET /services/shipment/v2/S1.A1.17373471 HTTP/1.1
Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}
curl -X GET -H "Token: APITokenSample-ca441e70288cB0515F310742" \
-H "Token: {API_TOKEN}" \
-H "X-Client-Source: {PARTNER_CODE}" \
"https://services.giaohangtietkiem.vn/services/shipment/v2/{TRACKING_ORDER}"
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://services.giaohangtietkiem.vn/services/shipment/v2/S1.A1.17373471",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_HTTPHEADER => array(
"Token: APITokenSample-ca441e70288cB0515F310742",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo 'Response: ' . $response;
?>
Response
Response
The system will return the result in JSON format. The returned data is described as follows:
| Parameter | Description |
|---|---|
| label_id | String - GHTK’s order label code |
| partner_id | String - Partner's order code |
| status | String - Order status code. Refer the order status code table |
| status_text | String - Order status |
| created | String - Order creation time, format: YY-MM-DD hh:mm:ss |
| modified | String - Last modified time of the order, format: YY-MM-DD hh:mm:ss |
| message | String - Order notes |
| pick_date | String - Scheduled pickup date (if available); if the order has already been picked up, this is the actual pickup date |
| deliver_date | String - Scheduled delivery date (if available); if the order has already been delivered, this is the actual delivery date |
| customer_fullname | String - Recipient’s full name |
| customer_tel | String - Recipient’s phone number |
| address | String - Recipient’s address |
| storage_day | Integer - Number of days the order is stored at the GHTK warehouse before being returned |
| ship_money | Integer - Shipping fee |
| insurance | Integer - Insurance fee |
| value | Integer - Insurance Value - the basis for compensation to the sender in case of loss or damage |
| weight | Integer - Order weight in grams |
| pick_money | Integer - COD amount |
| is_freeship | Integer - Freeship for the recipient |
Success
{
"success": true,
"message": "",
"order": {
"label_id": "S1.A1.17373471",
"partner_id": "1234567",
"status": "1",
"status_text": "Chưa tiếp nhận",
"created": "2016-10-31 22:32:08",
"modified": "2016-10-31 22:32:08",
"message": "Không giao hàng 1 phần",
"pick_date": "2017-09-13",
"deliver_date": "2017-09-14",
"customer_fullname": "Vân Nguyễn",
"customer_tel": "0911222333",
"address": "123 nguyễn chí thanh Quận 1, TP Hồ Chí Minh",
"storage_day": "3",
"ship_money": "16500",
"insurance": "16500",
"value": "3000000",
"weight": "300",
"pick_money": 47000,
"is_freeship": "1"
}
}