Products
Operation related to products in Deeple system
Structure
Product structure
Field name | Types | Required/Optional | Description |
---|---|---|---|
productCode | string(30) | R | Product's code |
name | string(50) | R | Product's name |
description | string(100) | O | Product's description |
images | list of object | O | Product's images |
price | number(10) | R | Product's price |
stock | number(10) | R | Product's stock |
promotion | object | O | Product'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 name | Types | Required/Optional | Description |
---|---|---|---|
src | string(30) | R | Image 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 name | Types | Required/Optional | Description |
---|---|---|---|
fullName | string(30) | R | Promotion's full name |
shortName | string(10) | R | Promotion's short name |
description | string(50) | R | Promotion'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 name | Types | Required/Optional | Description |
---|---|---|---|
userId | string(36) | R | User’s id from either LINE or Facebook |
postalCode | string(10) | O | User’s postal code |
originalText | string(50) | O | User’s original text |
entities | list of string (30) | O | Entities extracted from the user’s original text |
searchResults (product code) | list of string (30) | O | Result 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 name | Types | Required/Optional | Description |
---|---|---|---|
userId | string(36) | R | User’s id from either LINE or Facebook |
postalCode | string(10) | O | User’s postal code |
productCode | string(30) | R | Product'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"
}
}