Products

Operation related to products in Deeple system

Structure

Product structure

Field nameTypesRequired/OptionalDescription
productCodestring(30)RProduct's code
namestring(50)RProduct's name
descriptionstring(100)OProduct's description
imageslist of objectOProduct's images
pricenumber(10)RProduct's price
stocknumber(10)RProduct's stock
promotionobjectOProduct's promotion

Example of product structure

{
"productCode": "VA-4527",
"name": "TGM ไทยซอสเซส 200 กรัม",
"description": "",
"images": [{ src: "https://google.com/image.png" }] // Always expected https image url
"price": 200,
"stock": 50,
"promotion": {
"fullName": "ซื้อ TGM ไทยซอสเซส 1 แถม 1",
"shortName": "1 แถม 1",
"description": "ซื้อ TGM ไทยซอสเซส 1 แถม 1"
}
}

Product's image structure

Field nameTypesRequired/OptionalDescription
srcstring(30)RImage url for products (Https expected)

Example of product's image structure

{
"src": "https://google.com/image.png" // Always expected https image url
}

Product's promotion structure

Field nameTypesRequired/OptionalDescription
fullNamestring(30)RPromotion's full name
shortNamestring(10)RPromotion's short name
descriptionstring(50)RPromotion's description

Example of product's promotion structure

{
"fullName": "ซื้อ TGM ไทยซอสเซส 1 แถม 1",
"shortName": "1 แถม 1",
"description": "ซื้อ TGM ไทยซอสเซส 1 แถม 1"
}

Search products

Search products from 3rd party API after Deeple extract entity from the user’s original text

Resource method

POST

Parameters

Request parameters from Deeple system to 3rd party API

Field nameTypesRequired/OptionalDescription
userIdstring(36)RUser’s id from either LINE or Facebook
postalCodestring(10)OUser’s postal code
originalTextstring(50)OUser’s original text
entitieslist of string (30)OEntities extracted from the user’s original text
searchResults (product code)list of string (30)OResult after using entities to search for the product in the system

Example request parameter

{
"userId": "U1325a29a021d91231239123",
"postalCode": "12345",
"originalText": "มีแฮม TGM มั้ย",
"entities": ["TGM ไทยซอสเซส"],
"searchResult": ["VA-4527", "VA-4017"]
}

Example expected response object

{
"products": [
{
"productCode": "VA-4527",
"name": "TGM ไทยซอสเซส 200 กรัม",
"description": "",
"images": [{ src: "https://google.com/image.png" }] // Always expected https image url
"price": 200,
"stock": 50,
"promotion": {
"fullName": "ซื้อ TGM ไทยซอสเซส 1 แถม 1",
"shortName": "1 แถม 1",
"description": "ซื้อ TGM ไทยซอสเซส 1 แถม 1"
}
},
{
"productCode": "VA-224922",
"name": "ดอยคำ พีชทาขนมปัง 200 กรัม",
"description": "แยมทาขนมปัง อร่อยมาก",
"images": [{ src: "https://google.com/image.png" }] // Always expected https image url
"price": 260,
"stock": 10,
"promotion": {}
}
]
}

Get product by product code

Search product by product code

Resource method

POST

Parameters

Request parameters from Deeple system to 3rd party API

Field nameTypesRequired/OptionalDescription
userIdstring(36)RUser’s id from either LINE or Facebook
postalCodestring(10)OUser’s postal code
productCodestring(30)RProduct's code

Example of request parameter

{
"userId": "U1325a29a021d91231239123",
"postalCode": "12345",
"productCode": "VA-4527"
}

Example expected response object

{
"productCode": "VA-224922",
"name": "ดอยคำ พีชทาขนมปัง 200 กรัม",
"description": "แยมทาขนมปัง อร่อยมาก",
"images": [{ src: "https://google.com/image.png" }] // Always expected https image url
"price": 260,
"stock": 10,
"promotion": {
"fullName": "ซื้อ ดอยคำ พีชทาขนมปัง 200 กรัม 1 แถม 1",
"shortName": "1 แถม 1",
"description": "ซื้อ ดอยคำ พีชทาขนมปัง 200 กรัม 1 แถม 1"
}
}