Skip to main content

11. API to retrieve the product list

The API returns a list of products (and their corresponding IDs) that match the search query.

The product ID will need to be included in the order submission API for certain specific workflows.

Endpoint

GET /services/kho-hang/thong-tin-san-pham?term=laptop

Headers

  • Token: {API_TOKEN}
  • X-Client-Source: {PARTNER_CODE}
  • Content-Type: application/json

Sample Request

GET /services/kho-hang/thong-tin-san-pham?term=laptop HTTP/1.1
Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}

Parameters

ParameterMandatoryDesc
termyesString - Product search term

Response

Case 1 : Shops that have previously registered order information or product information on the GHTK system.

{
"success": true,
"data" : [
{
"full_name": "Laptop Asus",
"product_code": "23304A3MHLMVMXX625",
"weigh": 2,
"cost": 8000000
},
{
"full_name": "Laptop Dell",
"product_code": "23304A3MHLMVMXX888",
"weigh": 2.5,
"cost": 12000000
}
]
}

Case 2 : Products whose information has never been entered into the GHTK system.

{
"success": true,
"data" : []
}
warning

In this case, the partner's order submission API should send product_code: "" so that the GHTK system generates a new product code.