Skip to main content

6. Order Label Printing API

This API is used to print the shipping label for GHTK orders

info

The order label is a sticker attached to the package, clearly displaying key order details such as the order code, barcode, product information, shipping method, ...

  • GHTK provides two label formats: portrait (vertical) and landscape (horizontal)
  • Supported paper sizes: A5 or A6 (A6 is the default)

Label Samples

A5 Landscape Label Sample:

A5 Portrait Label Sample:

Request

GET /services/label/{TRACKING_ORDER}?original={ORIGINAL}&paper_size={PAPER_SIZE}

Headers

Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}

Parameter

ParameterRequiredDescription
TRACKING_ORDERYesGHTK’s tracking code
ORIGINALNoString - Label printing format portrait (vertical) or landscape (horizontal) (default is portrait)
PAPER_SIZENoString - Paper size of A5, A6 label (default is A6)

Code

GET /services/label/{TRACKING_ORDER} HTTP/1.1
Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}

Response

Response

The system will return the result in binary file PDF format. The returned data is described as follows:

Success

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename=""
Content-Transfer-Encoding: binary

When an error occurs

Returned result will be in JSON format

{
"success": false,
"message": "Mã vận đơn không hợp lệ, không tìm thấy vận đơn"
}