Skip to main content

11. Product Information API

This API returns a list of products (along with their product IDs) based on a search keyword

  • Product codes are required in specific operational flows when placing an order via the order creation API

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

ParameterRequiredDescription
termyesString - Name of products requiring information

Response

Case 1: The shop has previously registered the product with GHTK

{
"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: The product has not been registered on GHTK before

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

In this case, the partner’s system must send product_code: "" in the order creation API request. GHTK’s system will then auto-generate a new product code.