Skip to main content

3. Order Creation API

Partners send a list of orders to Giaohangtietkiem’s system via APIs. Once the orders are successfully saved into GHTK’s system, the system will return a corresponding list of orders containing the relevant details of each one.

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
}
}

Parameters

ParametersRequiredDescription
orderyesObject - Order information to be sent to GHTK
productsyesArray - List of products. See the next table for detailed description of product fields
order.idyesString - Partner's order code in their system
Pickup Information
order.pick_nameyesString - Name of the contact person for pickup
order.pick_moneyyesInteger - CoD amount (in VND). If 0, no cash collection is required
order.pick_address_idnoString - Pickup location ID from the customer’s order management page. This field will take priority if not empty
order.pick_addressyesString - Short pickup address (e.g., House No. 5, Block 3, Alley 11, Lane 45)
order.pick_provinceyesString - Province/City of the pickup location
order.pick_districtyesString - District of the pickup location
order.pick_wardnoString - Ward/Commune of the pickup location
order.pick_streetnoString - Street name of the pickup location
order.pick_telyesString - Pickup contact phone number
order.pick_emailnoString - Pickup contact email address
Delivery Information
order.nameyesString - Recipient's full name
order.addressyesString - Detailed delivery address (e.g., CT1 Building, Alley 58, Tran Binh Street)
order.provinceyesString - Province/City of the recipient
order.districtyesString - District of the recipient
order.wardyesString - Ward/Commune of the recipient (Required if street is not provided)
order.streetyesString - Street name of the recipient (Required if ward/commune is not provided)
order.hamletyesString - Hamlet/Village/Cluster/... of the recipient. If not applicable, enter "Other"
order.telyesString - Recipient’s phone number
order.notenoString - Order note (e.g., Maximum chargeable weight: 1.00 kg). From Feb 24, 2020, max 120 characters allowed
order.emailyesString - Recipient’s email address
Return Address
order.use_return_addressnoInteger - Default is 0. This field accepts either a value of 0 or 1. A value of 0 means the return address is the same as the pickup address, so the return address fields can be omitted. A value of 1 means a different return address is used, and all corresponding return address fields must be provided
order.return_nameyesString - Return recipient name
order.return_addressyesString - Detailed return address (e.g., House A, Alley 100)
order.return_provinceyesString - Province/City of the return address
order.return_districtyesString - District of the return address
order.return_wardnoString - Ward/Commune of the return address
order.return_streetnoString - Street of the return address
order.return_telyesString - Return recipient phone number
order.return_emailyesString - Return recipient email address
Additional Information
order.is_freeshipnoInteger - Free shipping for receiver. 1 means receiver pays only CoD amount that equals (pick_money), 0 means receiver pays CoD + shipping fee. Default is 0
order.weight_optionnoString - Weight unit of items in packages, either gram or kilogram. Default is kilogram
order.total_weightnoDouble - Total weight of the package. If omitted, calculated from products.weight
order.pick_work_shiftnoInteger - Pickup work shift: 1 = morning, 2 = afternoon, 3 = evening. GHTK will auto-assign by default
order.deliver_work_shiftnoInteger - Delivery work shift: 1 = morning, 2 = afternoon, 3 = evening. GHTK will auto-assign by default
order.label_idnoString - Pre-assigned order label from partner. Not available by default - service-specific configuration
order.pick_datenoString YYYY/MM/DD - Scheduled pickup date. Not available by default - service-specific configuration
order.deliver_datenoString YYYY/MM/DD - Scheduled delivery date. Not available by default - service-specific configuration
order.expirednoString YYYY/MM/DD hh:mm:ss - Auto-calculated time. Not available by default - service-specific configuration
order.valueyesInteger (VNĐ) - Declared value, which is a base for insurance and compensation fee calculation when an incident occurs.
order.opmnoInteger (VNĐ) - 1 for CoD only (no delivery), 0 for default full delivery
order.pick_optionnoString - Either cod or post. Default is cod. Indicates whether the item is picked up (cod) or dropped off by shop at post office (post)
order.actual_transfer_methodnoString - This field saves the transfer method of an order, default is by air (fly). If on ground (road), GHTK will notify about the change
order.transportnoString - Shipping method: road (ground), fly (air). If invalid, GHTK will fall back to the default method
order.deliver_optionnoString - Value is xteam if using xfast delivery option
order.tagsnoArray - Order Tagging: An array of tags to label the order. The list of available tags is described in the following table
order.sub_tagsnoArray - Array - Sub Tags: An array of detailed tag information. This field is mandatory when tagging the order as a "Live Plants"

products parameters

ParameterRequiredDescription
nameyesString - Product name
pricenoInteger - Product price
weightyesDouble - Product weight in kilograms
quantitynoInteger - Product quantity
product_codenoString - Product code taken from the API to get product information list

tags description

TagDescriptionDetailed
1FragileItems made from materials that can easily break or be damaged in transit. A 20 % surcharge is added to the total service fee (shipping + insurance, if any). If damage occurs, GHTK takes full responsibility for the order tagged Fragile.
2High‑Value / SpecialGoods valued over 3,000,000 VND (of B2C shops) or 1,000,000 VND (of C2C shops). High-value goods will incur an additional insurance fee, which covers risks during transportation or storage. An additional insurance fee of 0.5 % of the product price is applied. In cases that the product is missing, GHTK will reimburse 100 % of the declared value (up to 20,000,000 VND) if valid proof of value/origin is provided (e.g., purchase invoices, valid receipts that match the product information on GHTK’s system, etc.). In cases where the seller cannot provide proof of origin and value of the goods, compensation will be limited to a maximum of 4 times the shipping fee.
7Dry Agricultural Produce / FoodDry food that needs no special storage is added a 10% surcharge of the total service fee (shipping + insurance, if any) . For items with short shelf life (< 30 days), the promised delivery date must be ≤ 7 days from pickup; otherwise the order will not be automatically stored in the warehouse; GHTK will return the package to the shop.
10Item PreviewThe recipient is able to view the product before accepting the delivery.
11Partial InspectionThe recipient may count items or check conditions without breaking factory seals. Surcharge: 2,000 VND per order.
13Shop Call‑BackA GHTK agent will contact the shop if problems such as wrong recipient information, unreachable customer, customer refuses the parcel arise.
17Partial DeliveryCustomer pays only for the items kept; remaining items are returned to the shop. Return fee: 5,000 VND for in‑province shipping, 50 % of initial shipping fee for inter‑province shipping.
18Partial ReturnCustomers may refuse items but still have to pay a fee to the shop. Default fee equals shipping fee, editable by shop. Returned portion is treated as a return order. Return fee: 5,000 VND for in‑province shipping, 50 % of initial shipping fee for inter‑province shipping
19Failed Delivery – Fee CollectedCustomers may refuse items but still have to pay a fee to the shop. Default fee equals shipping fee, editable by shop. Returned portion is treated as a return order. Return fee: 5,000 VND for in‑province shipping, 50 % of initial shipping fee for inter‑province shipping. Note: Partners must include the not_delivered_fee field with a value greater than 0 and less than or equal to 20,000,000 VND
20Original PackagingManufacturer‑boxed goods must remain intact during transit.Surcharge: 1,000 VND per order.
22Letters / DocumentsLetters and documents are packed securely to prevent damage.
39Fresh / Frozen FoodIf fresh and frozen items with shelf life in 1 day are undeliverable, GHTK returns them to the shop the same day.
40Small ItemsItems have weight ≤ 300 g and combined dimensions ≤ 20 cm. These items must be packed in an envelope of at least 110 × 120 mm.
41Non‑Stackable ItemsItems easily crushed or deformed; must not have other parcels stacked on top.
42Orientation‑Sensitive ItemsItems that must remain upright or in a specific orientation to stay safe and intact
75Live PlantsOrders tagged “Live Plants” are transported via a dedicated handling flow to extend storage time and minimize external appearance damage.

sub_tags description

Sub tag detailDescription
1Seeds
2Seedlings
3Bagged plants
4Plants in fragile pots
5Other types of plants

Response

When an order is successfully created:

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

When an error occurs:

{
"success": false,
"message": "Chưa có thông tin order"
}
warning

GHTK's process does not allow an order code to be pushed again if it has already been successfully created on the GHTK’s system. In the case where the order.id already exists on the GHTK system occurs, the API will return an error along with the following information:

  • partner_id: the partner's order code
  • ghtk_label: GHTK's order label
  • created: the time when the order was created
  • status: the current status of the 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", // id trong request đẩy sang của bạn
"ghtk_label": "S1.A1.1737345", // nhãn đơn GHTK, tương ứng với id của bạn
"created": "2016-11-02T12:18:39+07:00",
"status": 5 // trạng thái đơn hàng hiện tại trên hệ thống GHTK, tra bảng mã trạng thái đơn trong phần webhook
}
}

Note

info

Note: The unit of weight GHTK uses for each product is kilograms (KG)

warning

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

warning

Note:

  • If the order is set is_freeship = 1,the COD will only collect from the recipient an amount equal to pick_money
  • If the value is set to 0, the COD will collect from the recipient an amount equal to pick_money + shipping fee of the order. The default value is 0.