Skip to main content

3. Submit Order API

This API is to submit an order to GHTK system.

Endpoint

POST /services/shipment/order

Headers

Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}
POST /services/shipment/order/?ver=1.5 HTTP/1.1
Token: APITokenSample-ca441e70288cB0515F310742
X-Client-Source: S308157
Content-Type: application/json
{
"products": [{
"name": "bút",
"weight": 0.1,
"quantity": 1,
"product_code": 1241
}, {
"name": "tẩy",
"weight": 0.2,
"quantity": 1,
"product_code": 1254
}],
"order": {
"id": "a4",
"pick_name": "HCM-nội thành",
"pick_address": "590 CMT8 P.11",
"pick_province": "TP. Hồ Chí Minh",
"pick_district": "Quận 3",
"pick_ward": "Phường 1",
"pick_tel": "0911222333",
"tel": "0911222333",
"name": "GHTK - HCM - Noi Thanh",
"address": "123 nguyễn chí thanh",
"province": "TP. Hồ Chí Minh",
"district": "Quận 1",
"ward": "Phường Bến Nghé",
"hamlet": "Khác",
"is_freeship": "1",
"pick_date": "2016-09-30",
"pick_money": 47000,
"note": "Khối lượng tính cước tối đa: 1.00 kg",
"value": 3000000,
"transport": "fly",
"pick_option":"cod" ,// Đơn hàng xfast yêu cầu bắt buộc pick_option là COD
"deliver_option" : "xteam", // nếu lựa chọn kiểu vận chuyển xfast
"pick_session" : 2 // Phiên lấy xfast
}
}

Input parameters:

ParameterDatatypeMandatory (Y)/(N)Description
orderObjectYDetailed information of order sent to GHTK.
productsArrayYList of products in the order.
order.idStringYPartner’s reference ID.
Order picking information
order.pick_nameStringYName of the contact person to pick up the order.
order.pick_moneyIntegerYCash amount which needs to be collected at delivery (in VND).
order.pick_address_idStringNAddress ID to pick up the order. This input takes precedence in identifying the pick up address if not null/empty. These ID can be find in tab "Edit shop information". If pick_address_id is valid, province name, district name,… of pick up address will be following this ID.
order.pick_addressStringYAddress string to pick up the order. E.g: nhà số 5, tổ 3, ngách 11, ngõ 45
order.pick_provinceStringYProvince to pick up the order. E.g: Hà Nội
order.pick_districtStringYDistrict to pick up the order. E.g: Cầu Giấy
order.pick_wardStringNWard to pick up the order. E.g: Mai Dịch
order.pick_streetStringNStreet to pick up the order. E.g: Nguyễn Chí Thanh
order.pick_telStringYPhone number of the contact person to pick up the order.
order.pick_emailStringNEmail contact to pick up the order.
Order delivery information
order.nameStringYName of the contact person to deliver the order.
order.addressStringYDetailed address to deliver the order. Eg: Chung cư CT1, ngõ 58, đường Trần Bình
order.provinceStringYProvince to deliver the order.
order.districtStringYDistrict to deliver the order.
order.wardStringYWard to deliver the order. (Required if street is none)
order.streetStringYStreet to deliver the order.(Required if ward is none)
order.hamletStringYHamlet to deliver the order. If it is non-information, please fill "Khác".
order.telStringYPhone number of the contact person to deliver the order.
order.noteStringNNote of the order. The maximum length of note is 120 characters. E.g: Khối lượng tính cước tối đa: 1.00 kg.
order.emailStringYEmail contact to deliver the order.
Order return information
order.use_return_addressInteger (0/1)NThis is to indicate if the return address should be different from pick up address. -"0" means return address is the same as pick up address hence the subsequence params (order.return_*) can be ignored. -"1" means return address is different from pick up address and GHTK should consider the subsequence params for order return. Default value is "0".
order.return_nameStringY if order.use_return_address=1Name of the contact person to return the order.
order.return_addressStringDetailed address to return the order.
order.return_provinceStringProvince to return the order.
order.return_districtStringDistrict to return the order.
order.return_wardStringNWard to return the order.
order.return_streetStringNStreet to return the order.
order.return_telStringY if order.use_return_address=1Phone number of the contact person to return the order.
order.return_emailStringYEmail contact to return the order.
Other informationorder.is_freeshipIntegerN
order.weight_optionStringNWeighing unit (gram/kilogram). Default value is kilogram.
order.total_weightDoubleNTotal weight of the order.Default value is sum amount of products.weight.
order.pick_work_shiftIntegerNTo indicate the order will be picked up at which time. "3" is in the evening. "2" is in the afternoon and "1" is in the morning. Default value is set automatically by GHTK.
order.deliver_work_shiftIntegerNTo indicate the order will be delivered at which time. "3" is in the evening. "2" is in the afternoon and "1" is in the morning. Default value is set automatically by GHTK.
order.pick_dateString YYYY/MM/DDNBooking the picking-up date of the order. This field is enabled for certain service levels.
order.deliver_dateString YYYY/MM/DDNBooking the delivering date of the order. This field is enabled for certain service levels.
order.valueIntegerYDeclared monetary value of the order package. The insurance fee is calculated based on this value. (in VND)
order.pick_optionStringNPossible value is "cod" (Carrier picks up parcels at shop’s pick up address) or "post" (shop drops the parcels at GHTK’s service points). Default value is cod
order.transportStringNThis is the transportation method to deliver the parcel. Possible value is "fly" or "road". If the transportation method is invalid, GHTK will switch automatically to default transportation method.
order.deliver_optionStringNis ‘xteam’ when the delivery method is XFAST service
order.booking_idStringOptionBooking id from the response of API get pick time (in case has XFAST service)
order.tagsArrayNPossible value is [1] : Display a glass shape on the label if the order has fragile product. Possible value is [7]: if the order has farm product, dry food.
order.pending_orderNumberNOrder for reserve flow
order.total_boxNumberNTotal box of order
order.heightNumberNOrder's height (cm)
order.lengthNumberNOrder's length (cm)
order.widthNumberNOrder's width (cm)
order.sub_tagsArrayNDetail options when you pick some services such as plant goods

Product parameters

nameStringYName of the product
priceIntegerNProduct’s price
weightDoubleYProduct’s weight
quantityIntegerNProduct’s quantity
heightIntegerNProduct’s Height (cm )
lengthIntegerNProduct’s Length (cm)
widthIntegerNProduct’s Width (cm)
product_codeStringNProduct’s code. This value is taken from product information list API

Tags description

Tag IDTagNhãn đơn hàngDescription
1FragileDễ vỡThe items made of fragile materials are prone to damage and breakage during transportation. If any damage occurs, GHTK will take full responsibility for orders marked as Fragile. Cost 1,000 VND per order.
2High-value itemsGiá trị caoItems valued at > 3,000,000 VND (for Pro Shop) and > 1,000,000 VND (for Standard Shop) will have an additional insurance fee, which is the insurance amount for risks during transportation or storage. The insurance fee is equal to 0.5% of the value of the goods. GHTK will reimburse 100% of the value when lost (maximum of 20,000,000 VND) if there is documentation proving the origin and value of the goods (import invoices, valid purchase invoices matching the product information on the GHTK system, etc.). If the shop cannot prove the origin and value of the goods, compensation will be a maximum of 04 times the shipping fee
7Agricultural ProductsHàng nông sảnFor agricultural products with a short shelf life (< 30 days), the scheduled delivery time will not exceed 7 days from the successful pickup. Beyond this deadline, the order will not be automatically stored, and GHTK will return the items to shop.
10Allowed to inspect the productCho xem hàngCustomers are allowed to inspect the product before accepting delivery.
11CrosscheckCho thử hàng/ đồng kiểmCustomers are allowed to count the quantity or check the condition of each item (excluding breaking seals on the products). Cost 2,000 VND per order.
13Call the shop when the customer does not receive the goods, cannot be contacted, or the information is incorrect.Gọi cho shop khi không giao được, //Gọi cho shop khi khách không nhận được hàng, không liên lạc được, sai thông tinGHTK staff will contact the shop in case of issues such as incorrect information, inability to contact the customer, or the customer refuses to receive the goods.
17Partial Delivery - Customer Selects ProductsGiao hàng 1 phần chọn sản phẩmCustomers are allowed to only accept and pay for a partial of the order. The remaining will be returned to shop with an intra-province fee of 5,000 VND per order and an interprovincial fee equal to 50% of the shipping fee.
18Partial Delivery - Product ReturnGiao hàng 1 phần đổi trả hàngAssistance in delivering one item to the customer and returning the remaining portion to the shop. The returned portion is treated as a return order with an intra-province fee of 5,000 VND per order and an inter-province fee equal to 50% of the shipping fee.
19Fee for unsuccessful delivery attempt.Không giao được thu phíSupporting customers who do not accept the product but collecting a partial fee for the shop. The fee to be collected defaults to the shipping fee, but the shop can adjust the amount they wish to collect. The returned portion for the shop is treated as a return order with an intra-province fee of 5,000 VND per order and an inter-province fee equal to 50% of the shipping fee. Note: Partners need to include an additional field "not_delivered_fee" with a value 0 < not_delivered_fee <= 20,000,000 VND.
20Whole boxHàng nguyên hộpItems packed in the manufacturer's box, requiring intact preservation during transportation. Cost 1,000 VND per order.
22Mail and documentsThư tínDocuments and files are carefully packaged to prevent damage to the products.
39Fresh foodThực phẩm tươiFor fresh and frozen food items with a same-day expiration date, if delivery to the customer is unsuccessful, GHTK will refund the order on the same day.
40Small goodsHàng nhỏItems with a weight of ≤ 300 grams.Small orders need to be packaged minimally in envelopes with dimensions of at least 110x120mm.
42Items requiring proper orientation.Hàng yêu cầu xếp đúng chiềuGoods must be arranged according to the correct orientation/direction of the product during transportation; otherwise, it will affect the safety and quality of the goods.
52Liquid goodsHàng chất lỏngLiquid goods are items with physical characteristics in liquid, adhesive, or viscous form. Liquid goods need to be contained in specialized bottles or sealed bags.
75Plant goodsHàng cây cốiOrders tagged with ‘plants’ will be transported by GHTK through a separate shipping channel to ensure extended storage time and minimize external impact

Sub Tags description

Sub Tag IDDescription
1Seed
2Young plants
3Plant with root ball
4Plant in a fragile pot
5Others

Response

Response for confirmed order:

{
"success": true,
"message": "",
"order": {
"partner_id": "123123a",
"label": "S1.A1.1737345",
"area": "1",
"fee": "30400",
"insurance_fee": "15000",
"estimated_pick_time": "Sáng 2017-07-01",
"estimated_deliver_time": "Chiều 2017-07-01",
"products": [],
"status_id": 2
}
}

Response for failed order:

{
"success": false,
"message": "{ERROR_MESSAGE}",
"error_code": "{ERROR_CODE}",
"log_id": "{LOG_ID}"
}
warning

Once an order is successfully submitted to GHTK system, it could not be reversed. In case the "order.id" already exists, shop will receive error response including

  • code: "ORDER_ID_EXIST"
  • partner_id: Partner ID
  • ghtk_label: GHTK tracking number with alias
  • created: created time of order
  • status: the current status of order
{
"success": false,
"message": "Mã đơn hàng của bạn đã tồn tại trên hệ thống GHTK",
"error": {
"code" : "ORDER_ID_EXIST",
"partner_id" : "a4",
"ghtk_label": "S1.A1.1737345",
"created": "2016-11-02T12:18:39+07:00",
"status": 5
}
}

Note

info

Note: GHTK uses kilograms (KG) as the unit of weight for each product.

warning

Note: The initial shipping fee will be calculated based on the total weight of the products in the order.

warning

Note:

  • If the order is set to is_freeship = 1, COD (Cash on Delivery) will only collect the amount specified in pick_money from the recipient.
  • If the value is set to 0 (default), COD will collect the amount specified in pick_money plus the shipping fee of the order from the recipient.